[
https://issues.apache.org/jira/browse/COUCHDB-791?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12878646#action_12878646
]
Robert Newson commented on COUCHDB-791:
---------------------------------------
Fwiw, my position has shifted a little. I think it's a just a little too
surprising that a write followed by a /etc/init.d/couchdb stop leads to data
loss with the default settings.
That is, since delayed_commits=true is the default, many people might not be
conscious of the small window of non-durability. Flipping the default
eliminates that concern but then makes out-of-box performance fairly dire
(which is why delayed_commit was flipped on by default, iirc).
A defensible middle ground is for /etc/init.d/couchdb/stop (the action
performed when shutting a machine down cleanly for h/w maintenance or kernel
upgrade, say) to flush pending writes to disk rather than discard them.
I think the safest pattern was, during the 'stop' script call;
1) PUT /_config/couchdb/delayed_commits -d "false"
2) call global sync() (flush all data to all databases)
That way any write between 1 and 2 will also be on disk. No 201 response will
be contradicted when the service starts on reboot.
> Changes not written if server shutdown during delayed_commits period
> --------------------------------------------------------------------
>
> Key: COUCHDB-791
> URL: https://issues.apache.org/jira/browse/COUCHDB-791
> Project: CouchDB
> Issue Type: Bug
> Affects Versions: 0.11.1
> Environment: Linux (Ubuntu 10.04)
> Reporter: Matt Goodall
>
> If the couchdb server is shutdown (couchdb -d, Ctrl+C at the console, etc)
> during the delayed commits period then buffered updates are lost.
> Simple script to demonstrate the problem is:
> db=http://localhost:5984/scratch
> curl $db -X DELETE
> curl $db -X PUT
> curl $db -X POST -d '{}'
> /path/to/couchdb/bin/couchdb -d
> When couchdb is started again the database is empty.
> Affects 0.11.x and trunk branches.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.