Details
-
Bug
-
Resolution: Fixed
-
Major
-
Morpheus, 7.6.2
-
Untriaged
-
0
-
Unknown
Description
We construct "UniqueKey" using docKey and docRevSeqNo. But since we skip targetCR with set_with_meta, we can have multiple mutations (atleast two mutations I can think of) with the same revID, breaking the uniqueness promise. Might need to look at monotonic integers for constructing unique keys.
KV team reasoning -
https://couchbase.slack.com/archives/CFJDXSGUA/p1711111783349729?thread_ts=1711110695.923309&cid=CFJDXSGUA
As of now, we know of 3 reasons as to when this situation can occur:
- RevID-based CR used. Source mutation wins even though revIDs are same, based on higher CAS/expiry/flags/xattrs.
- CAS-based CR used. Source wins because of higher CAS but revIDs are equal.
- Any CR mode. Cluster A has no HLV, Cluster B has no HLV. A mutation from cluster A is replicated to cluster B, which is replicated back to A as a special case where CR is done using xattrs (source wins when source_has_xattrs && !target_has_xattrs)
(1) and (2) - two mutations with same <key, revID> can be in the same xmem batch and hence can break things.
(3) - two such mutations won't be in a single xmem batch and shouldn't be a problem.
Attachments
For Gerrit Dashboard: MB-61265 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
207611,4 | MB-61265: Move to monotonic counter for unique-key instead of revID | master | goxdcr | Status: MERGED | +2 | +1 |
207655,2 | MB-61265: Move to monotonic counter for unique-key instead of revID | trinity | goxdcr | Status: MERGED | +2 | +1 |