Details
-
Bug
-
Resolution: Fixed
-
Minor
-
2.0-beta
-
Security Level: Public
-
Windows 7, discovered using the .NET Client Library 1.2-Beta
Description
When testing the CouchbaseClient.Decrement(Key, Default, Delta, CAS), it was discovered that the server is not honoring the invalid CAS and is successfully Decrementing the value. Matt confirmed with Trond that this is a server issue.
Workaround: perform a set/replace with CAS instead of a incr/decr, doing the incr/decr on the client side.
var decrementResult = client.Decrement(key, 100, 10);
var casResult = client.GetWithCas(key);
var result = client.Decrement(key, 100, 10, casResult.Cas - 1); //result is true, but should be false