-
Notifications
You must be signed in to change notification settings - Fork 5.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
*: lock unchanged rows for pessimistic transaction (#14045) #14050
Conversation
CI failed @coocood |
|
||
tk2.Se.GetSessionVars().LockWaitTimeout = 1 | ||
tk2.MustExec("begin pessimistic") | ||
err := tk2.ExecToErr("select * from unchanged where id = 1 for update") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the LockWaitTimeout
is set to 1ms, it runs fast.
nowait
is not picked to 3.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be picked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't need to pick it for now.
LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/merge |
1 similar comment
/merge |
/run-all-tests |
cherry-pick #14045 to release-3.0
What problem does this PR solve?
The pessimistic lock is not acquired if a row is unchanged.
What is changed and how it works?
Add the unchanged row key to TxnCtx, later collect them before calling LockKeys.
Check List
Tests
Related changes
Release note