Hi. I have a question about XDCR Conflict Resolution Process.
This is what it says in the Conflict Resolution Process section of this page.
"If a document is deleted on the source, XDCR makes no metadata comparison on the source before replication."
Then, if the source document is deleted, will the target document be deleted without any comparison of metadata?
I’ll be waiting for your answer.
The statement that’s being quoted is a bit out-of-context. It is part of the description of an XDCR performance optimization called “XDCR Optimistic Replication Threshold” (
https://docs.couchbase.com/server/6.5/xdcr-reference/xdcr-advanced-settings.html) that is being used to describe the conflict resolution process in detail.
So, read in context:
As a performance optimization, XDCR makes no metadata comparison on the source for documents of 256 bytes or less, thus making unnecessary a metadata fetch from the target cluster: instead, the document is replicated immediately to the target, and metadata comparison is performed there. If a document is deleted on the source, XDCR makes no metadata comparison on the source before replication. (and the metadata comparison is performed on the target)
Internally, a deleted document leaves a tombstone – basically, a document with metadata but empty body – the tombstone metadata is used to compare with the target document’s metadata to determine which prevails in a conflict scenario. You can easily check this by pausing replication, deleting a document (that is currently in sync with target ) on the source, and then, on the target side, modifying the document (not deleting). When the xdcr replication is resumed, the target document will not be deleted since it was modified later than the source document that was deleted (i.e. the target document wins the conflict resolution).