-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sql/kv: unexpected unique constraint violation on UPDATE #43928
Comments
The bisect indicates that this was recently fixed by f6a4dc5. |
Given that that's the fix, I suspect we were incorrectly handling a re-issued CPut that had previously succeeded after the successful RefreshRange. |
Surprisingly, this isn't due to #35140. |
I think I see it. f6a4dc5#diff-e6e4d9675c8a7912b5c54b2f4c460df6L181 looks wrong. The condition should be |
That bug was also present in |
Fixes cockroachdb#43928. This commit fixes a bug in `MVCCMetadata.GetPrevIntentSeq` that was present since its inception (a147f24). The method was failing to properly look up the previous intent sequence when the last sequence in the sequence history should have been returned. This could cause errors for read-write KV ops like CPut, InitPut, and Increment. This commit does not need to land on master because it was already fixed there by f6a4dc5. It will need to end up on release-19.1 as well though. Release note (bug fix): A SQL row write that is re-issued after already succeeding will no longer throw a duplicate key error when the previous write in its transaction deleted the row.
Fixed by #43937. |
Fixes cockroachdb#43928. This commit fixes a bug in `MVCCMetadata.GetPrevIntentSeq` that was present since its inception (a147f24). The method was failing to properly look up the previous intent sequence when the last sequence in the sequence history should have been returned. This could cause errors for read-write KV ops like CPut, InitPut, and Increment. This commit does not need to land on master because it was already fixed there by f6a4dc5. It will need to end up on release-19.1 as well though. Release note (bug fix): A SQL row write that is re-issued after already succeeding will no longer throw a duplicate key error when the previous write in its transaction deleted the row.
To reproduce:
Expected:
UPDATE
statements should not throw unique constraint violation errors.Scope:
This does not reproduce on the v19.1 release binary or on
master
. It only reproduces on a v19.2 release binary (v19.2.0 and v19.2.2 tested so far).It also reproduces regardless of the
kv.transaction.parallel_commits_enabled
cluster setting, meaning that parallel commits is not to blame.Trace:
The text was updated successfully, but these errors were encountered: