Durability requirement failed: The CAS on the active node changed for ID “XXX, indicating it has been modified in the meantime

We are doing node failover testing. When we failover a node, our writes are failing with DurabilityException though that’s not the primary node for that write

multiClusterBucket
.mutateIn(key, 5, TimeUnit.SECONDS)
.upsert(UpsertDate.ID_UPSERT_DATE_UTC, UpsertDate.toUTC())
.arrayPrependAll(“somepath”, somecollection),
SubdocOptionsBuilder.builder().createPath(true))
.execute(PersistTo.ONE, ReplicateTo.ONE);

Any help will be appreciated. TIA

In this case, if you fail the replica node, this write will fail. The condition is send the ack if the doc is written to primary and replica - like the example here - https://docs.couchbase.com/java-sdk/2.2/durability.html

In 6.5, durability capabilities were greatly enhanced.
https://docs.couchbase.com/server/6.5/learn/data/durability.htm

1 Like

@tim.wong thanks for reply. We have 3 nodes and 2 replica and we just brought down 1 replica. So this should have worked as one of the replica is up.

@aqua123 this error is different. It tells you that the original document has been modified on the active so there might be concurrency going on?

I can only recommend to enable mutation tokens on the environment since that should alleviate the concurrency issue.