You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Robert Newson (JIRA)" <ji...@apache.org> on 2015/01/08 11:10:35 UTC
[jira] [Closed] (COUCHDB-2536) During replication, documents with
the same key are not properly replaced
[ https://issues.apache.org/jira/browse/COUCHDB-2536?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Robert Newson closed COUCHDB-2536.
----------------------------------
Resolution: Not a Problem
This is by design.
When you replicated A to B you introduce a conflict on B. Your B server contains both the "foo" and "bar" branch of your "mykey" document. A consistent, but arbitrary tie-breaker algorithm selected "foo" to display when fetching the document (though you can retrieve the other or all versions if you wished). When you deleted "foo" on B, you promoted the other branch.
CouchDB replication does not overwrite data, it will retain all your concurrent edits.
> During replication, documents with the same key are not properly replaced
> -------------------------------------------------------------------------
>
> Key: COUCHDB-2536
> URL: https://issues.apache.org/jira/browse/COUCHDB-2536
> Project: CouchDB
> Issue Type: Bug
> Security Level: public(Regular issues)
> Components: Database Core
> Affects Versions: 1.6.1
> Environment: Windows 7 (64bit)
> Reporter: Dennis
>
> Hi,
> We have two database A and B.. Database A contains documents having the same ids as documents in database B. Our goal was to replace the documents of database B with the documents of database A, iff the document have the same id. Therefore, we replicated the content of database A to database B. At first it seems to work perfectly but then we discovered the following issues:
> If we delete a document in database B which was replaced by a document of database A, then the document which was replaced reappeared.
> Minimal setup to reproduce this behaviour:
> Database A contains a document {"_id": "mykey", "content" : "foo"}
> Database B contains a document {"_id": "mykey", "content" : "bar"}
> Replicate database A to Database B (using the CouchDB replicator).
> Database B now contains a document {"_id": "mykey", "content" : "foo"} as expected. This document has now previous versions.
> If document with the key "mykey" is deleted in database B, the document {"_id": "mykey", "content" : "bar"} reappears in the database.
> Why does the replaced document reappear? Is this the intended behaviour of CouchDB or a bug?
> We expected to get a conflict during replication or that maybe the existing document in database B is set as the previous version of the document, by which it was replaced. But the current behaviour was unexpected.
> We are using CouchDB 1.6.1 on Windows 7 (64bit).
> Best regards
> Dennis
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)