couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Candler (JIRA)" <>
Subject [jira] Commented: (COUCHDB-449) Turn off delayed commits by default
Date Thu, 06 Aug 2009 08:43:14 GMT


Brian Candler commented on COUCHDB-449:

Just to be clear: _changes is supposed only to update after a commit has
taken place, not after a write?

If so, I cannot demonstrate it. If I write a document and then immediately
read _changes, it always appears. See below at (*).

Furthermore, the same is true if I run

$ curl

in another window. As soon as I add a document in the first window, it
appears in the _changes feed.

My very rough scan of the source suggests that a delayed commit should take
place after 1 second:

    Delay and (Db#db.waiting_delayed_commit == nil) ->
                erlang:send_after(1000, self(), delayed_commit)};

So if that's right, and what you say is true, then I would expect not to see
the document in _changes for this long.

OTOH, with batch=ok the commit is delayed indefinitely. I have raised this
as a separate ticket COUCHDB-454)

All tested with HEAD (git commit aebdb31001126dab6b579b8cc2e605ef7ec499c6)
and 12b5 under Jaunty.



$ curl -X DELETE
$ curl -X PUT
$ curl


$ curl -X POST -d'{}'; curl

$ curl -X POST -d'{}'; curl

$ curl -X POST -d'{}'; curl

$ curl -X POST -d'{}'; curl -X POST -d'{}';
curl -X POST -d'{}'; curl

> Turn off delayed commits by default
> -----------------------------------
>                 Key: COUCHDB-449
>                 URL:
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Database Core
>    Affects Versions: 0.9, 0.9.1
>            Reporter: Jan Lehnardt
>            Priority: Blocker
>             Fix For: 0.10
> Delayed commits make CouchDB significantly faster. They also open a one second window
for data loss. In 0.9 and trunk, delayed commits are enabled by default and can be overridden
with HTTP headers and an explicit API call to flush the write buffer. I suggest to turn off
delayed commits by default and use the same overrides to enable it per request. A per-database
option is possible, too.
> One concern is developer workflow speed. The setting affects the test suite performance
significantly. I'd opt to change couch.js to set the appropriate header to enable delayed
commits for tests.
> CouchDB should guarantee data safety first and speed second, with sensible overrides.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message