CASMismatchException and partial updates

I call the replace( document, PersistTo.MASTER , ReplicateTo.ONE) in my code , and it throws CASMismatchException sometimes, before adding a retry logic for the same , I would like to know ,

  1. Is there a possibility that persisting in master is done and before doing replication CASMismatchException is throw in this scenario …?

  2. Is there a possibility that , replication to any one node is done , and before doing persisting in master , this CASMismatchException is throw …?

In short , is there a possibility that , my ‘replace’ call is ended up in partial updates ( ended up before completing the operation ) …? or is the ‘replace’ call is idempotent and both persistence and replication is not done when the CASMismatchException is thrown …?

Am using CB server V3.0.1 community edition and java client sdk v2.1.

Hi @mariselvam,

the actual replace operation and the subsequent durability requirement polling are distinct operations. So if you get a CASMismatchExceptions, the durability polling (persistTo, replicateTo) hasn’t even started.

Also the actual replication and persistence is handled by the server side, but if it denies the replacing of the data because of a cas mismatch, there is nothing new to replicate or persist.

So, you don’t need to worry about “partial updates”.

Thanks for your response daschl

1 Like