CAS and xDCR

If xDCR happens for a particular key/value on a particular node will that updated key get a new CAS value that resulted from the xDCR operation?

In summary do keys get new CAS values from both set and xDCR update operations?

1 Answer

« Back to question.

Hello,

The replication using XDCR does not change the metadata so the CAS value will be the same when a document is saved in ClusterA and pushed in other Clusters.

XDCR operations do not update the metadata.

In addition, to answer the question asked in the comment, about the counters. Counters are key like any other, so then you increment or decrement one this means you update the value. So XDCR will replicate the value to the other nodes. Once gain a counter is a value... like any other.

The only important part about the counter is the fact that, across different cluster Couchbase has no way to guarantee de consistency. Suppose you have the same key named "counter_xxx" with a value of 3, that is replicated in 2 clusters, one in the US, one in Europe. If you have 2 processes doing a incr("counter_xxx") both values will be to 4, and then result of the bidirectional replication will be 4. So just be careful on this

Regards
Tug
@tgrall