incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Leddy <>
Subject Encountered all_dbs_active with compaction daemon on trunk
Date Mon, 05 Sep 2011 17:46:14 GMT

I decided to test out the latest trunk on one of my nodes with some
2,500 databases. On activating the compaction daemon it became apparent
that some databases were being opened but not closed. 

Looking at the debug logs it became clear that when a database did not
need to be compacted it was remaining open (confirmed with lsof).

I made a small one line patch which seems to have resolved the problem:

--- a/src/couchdb/couch_compaction_daemon.erl
+++ b/src/couchdb/couch_compaction_daemon.erl
@@ -185,6 +185,7 @@ maybe_compact_db(DbName, Config) ->
         false ->
+            couch_db:close(Db),
             maybe_compact_views(DbName, DDocNames, Config)
     _ ->

This makes sure that when can_db_compact returns false that
couch_db:close is called. [I have to admit it seems strange 
to me to call couch_db:close in four different places to clean
up the the one couch_db:open_int but my erlang coding skills
are weak.]



View raw message