[Cloned this from MB-33813 to track merging a fix for this issue to 5.5.4.]
There is a race condition in ArithmeticCommandContext where a SET operation is performed between the ArithmeticCommandContext::getItem() and ArithmeticCommandContext::storeNewItem(), causing the call to bucket_store() to return ENGINE_NOT_STORED. Currently we just return this error to the memcached client however, this brakes the behaviour of this interface that existed before the refactoring of our arithmetic operations (see v4.5.0). Thus, we should resolve this race condition by trying to re-perform the arithmetic operation by resetting the ArithmeticCommandContext state machine.
|For Gerrit Dashboard: MB-33852|
|107944,4||MB-33852: Fix NOT_STORED being returned from arithmetic op||vulcan||kv_engine||Status: MERGED||+2||+1|
|108004,1||MB-33854: Merge remote-tracking branch 'couchbase/vulcan' into alice||alice||kv_engine||Status: MERGED||+2||+1|
|108012,2||Merge remote-tracking branch 'couchbase/alice'||master||kv_engine||Status: MERGED||+2||+1|