You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Dennis (JIRA)" <ji...@apache.org> on 2015/01/08 10:04:34 UTC

[jira] [Created] (COUCHDB-2536) During replication, documents with the same key are not properly replaced

Dennis created COUCHDB-2536:
-------------------------------

             Summary: 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
            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)