On 27/06/2010 12:01 PM, Damien Katz wrote:
Mark, looks like it's the file:sync calls. Can you try this patch?

Index: src/couchdb/couch_file.erl
===================================================================
--- src/couchdb/couch_file.erl  (revision 957790)
+++ src/couchdb/couch_file.erl  (working copy)
@@ -148,7 +148,7 @@
  %%----------------------------------------------------------------------

  sync(Filepath) when is_list(Filepath) ->
-    {ok, Fd} = file:open(Filepath, [read, raw]),
+    {ok, Fd} = file:open(Filepath, [write, raw]),
      try file:sync(Fd) after file:close(Fd) end;
  sync(Fd) ->
      gen_server:call(Fd, sync, infinity).

I made that patch and it looked good for a while. The 'all_docs' test passes, but the 'basics' test fails with the traceback at http://pastebin.com/6ZZU8B6q. As you will see at the end, couch itself stopped, so no other requests could be made.

Attempting to restart couch then failed with a similar traceback at it comes up - http://pastebin.com/4A1QEDq3. My reading of it is that the DB is somehow corrupted (it can't find a valid header). If I stop couch, delete all .couch files from the file-system and restart, it starts up fine again and re-attempting the 'basics' test does exactly the same thing again.

Note that all the above was after re-enabling the auth database, but I don't think the problem is related to that specifically.

Mark

Reply via email to