You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Ian Morgan <ia...@outlook.com> on 2014/06/23 14:35:04 UTC

Replication rollback

Hi, I posted a message on SO, but here is probably a better place. Here's my question regarding handling replication.
I want to be able to prevent a 'push' (or replication) to the central CouchDB instance from a user's local instance (where there are many users) if there are any conflicts - essentially copying the functionality from something like Git or Mercurial, where users have to resolve conflicts on their local copy before pushing to the central server (so the server can remain 'clean').
As far as I can see, there are two options; preventing a user from committing if there are conflicts (although I can't see any way to do this without actually completing the replication), or completing the replication, seeing if there are any conflicts, and then deleting the pushed replication (and the associated documents) if there are conflicts (though this could also result in undesirable behaviour if a pull is completed before the documents are re-deleted, as well as being a bit inefficient).
I would like a replication to roll back if there is a conflict, and to inform me that a conflict has occurred (I don't care about the nature of the conflict, because then I can initiate a pull request replication to replicate the central db on the local db).
Thanks, Ian.