Hi Wout,
good find! I'd say it is an API misuse at this point, but of course,
CouchDB should handle this more gracefully.
The patch below fixes the problem fairly high up in the db_updater
module. The actual fix might has to go into the start_copy_compact/1
function, but I'd rather leave this for Damien.
Also, this is not a blocker for 0.9 :)
Wout, if this is still open tomorrow, can you file a bug?
Cheers
Jan
--
Index: /Users/jan/Work/couchdb/trunk/src/couchdb/couch_db_updater.erl
===================================================================
--- /Users/jan/Work/couchdb/trunk/src/couchdb/couch_db_updater.erl
(revision 757850)
+++ /Users/jan/Work/couchdb/trunk/src/couchdb/couch_db_updater.erl
(working copy)
@@ -139,6 +139,9 @@
{reply, {ok, Db2#db.update_seq, IdRevsPurged}, Db2}.
+handle_cast(start_compact, #db{update_seq=Seq}=Db) when Seq =:= 0 ->
+ % do not attemt to compact empty dbs
+ {noreply, Db};
handle_cast(start_compact, Db) ->
case Db#db.compactor_pid of
nil ->
On 24 Mar 2009, at 23:26, Wout Mertens wrote:
> Hi,
>
> try this on latest trunk (and several before that I think):
>
> 1. Create an empty database
> 2. Compact it
>
> Result => lots of ugly backtraces from couchdb.
>
> Is this a bug or a misfeature? Should I file a bug, if so, what info
> should I give?
>
> Cheers,
>
> Wout.
>
|