couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <>
Subject [Couchdb Wiki] Update of "How to replicate a database" by BrianCandler
Date Wed, 28 Jan 2009 17:20:25 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for change notification.

The following page has been changed by BrianCandler:

The comment on the change is:
Add info about resolving conflicts plus a small shell script

  All nodes see the same conflict state and history, so any of them can resolve the conflict.
- ''FIXME: How to resolve the conflict? Simply writing a new version of the document is not
+ Nodes can continue to add new versions, but conflict remains:
  $ curl -X PUT -d '{"_rev":"2575525432","hello":"resolved"}' http://localhost:5001/sampledb/doc1
@@ -191, +191 @@

+ Once the application is satisfied that it has resolved the conflict, it simply has to DELETE
the conflicting revision. Couch actually keeps a separate list of deleted conflict revisions
that you can view with "deleted_conflicts=true"
+ {{{
+ $ curl -X DELETE
+ {"ok":true,"id":"doc1","rev":"3699698383"}
+ $ curl
+ {"_id":"doc1","_rev":"804871722","hello":"resolved"}
+ $ curl
+ {"_id":"doc1","_rev":"804871722","hello":"resolved","_deleted_conflicts":["3699698383"]}
+ }}}
  === Sample shell script ===
- Running this script gives an easy way to demonstrate replication behaviour.
+ Running this script gives an easy way to set up a replication conflict so you can examine
it and resolve it.

View raw message