couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filipe David Manana <>
Subject gen_server timeout after compaction patch
Date Tue, 12 Oct 2010 15:40:27 GMT
Hi all,

I have a large DB (about 6,5 Gb after compaction) that every time it's
compacted, immediately

diff --git a/src/couchdb/couch_db_updater.erl b/src/couchdb/couch_db_updater.erl
Sometimes (too often actually), after compacting a large DB (6,5Gb), I
get gen_server call timeouts (calls to couch_db gen_server, message
{db_updater, Db}). Resulting in big stack traces and a restart of the
couch_server process. The following 1 line patch fixes it:

index 93faba0..40f393e 100644
--- a/src/couchdb/couch_db_updater.erl
+++ b/src/couchdb/couch_db_updater.erl
@@ -187,7 +187,7 @@ handle_cast({compact_done, CompactFilepath},
#db{filepath=Filepath}=Db) ->
         couch_file:delete(RootDir, Filepath),
         ok = file:rename(CompactFilepath, Filepath),
-        ok = gen_server:call(Db#db.main_pid, {db_updated, NewDb2}),
+        ok = gen_server:call(Db#db.main_pid, {db_updated, NewDb2}, infinity),
         ?LOG_INFO("Compaction for db \"~s\" completed.", []),
         {noreply, NewDb2#db{compactor_pid=nil}};
     false ->

Anyone against committing it?


Filipe David Manana,,

"Reasonable men adapt themselves to the world.
 Unreasonable men adapt the world to themselves.
 That's why all progress depends on unreasonable men."

View raw message