You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MB-33852: Fix NOT_STORED being returned from arithmetic op
(Backport of MB-33813 to 5.5.x).
Currently we are returning NOT_STORED when bucket_store()
returns ENGINE_NOT_STORED. This is due to a race condition
when a key of the same name as this arithmetic operation is stored
between ArithmeticCommandContext::getItem() calling bucket_get()
and ArithmeticCommandContext::storeNewItem() calling bucket_store().
Thus, causing the bucket_store() to fail. In this case we should
handle this.
To fix this, this patch resets the ArithmeticCommandContext
state machine by calling changing the state to Reset. When
we see ENGINE_NOT_STORED returned to
ArithmeticCommandContext::storeNewItem() by bucket_store().
This patch also adds a unit test to check that we return
ENGINE_SUCCESS and that we correctly re-try the arithmetic
operation.
Change-Id: If476ff83871c6f158f01bea82c6575e0ebfd65c9
Reviewed-on: http://review.couchbase.org/107944
Tested-by: Build Bot <[email protected]>
Reviewed-by: Dave Rigby <[email protected]>
Well-Formed: Build Bot <[email protected]>
0 commit comments