pessimistic-transaction: clarify Point Get lock behavior for non-existing keys under different isolation levels (#23111)#23138
Conversation
Co-authored-by: Grace Cai <qqzczy@126.com>
There was a problem hiding this comment.
Code Review
This pull request updates the pessimistic transactions documentation to clarify that Point Get and Batch Point Get operators do not lock non-existent keys under the Read Committed isolation level. The review feedback suggests a minor improvement to avoid repeating the operator names in consecutive sentences, enhancing readability in accordance with the style guide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: qiancai The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This is an automated cherry-pick of #23111
What is changed, added or deleted? (Required)
Added a Note in the
Behaviorssection ofpessimistic-transaction.mdto clarify that the Point Get and Batch Point Get lock behavior for non-existing keys applies only to theREPEATABLE READisolation level.Under the
READ COMMITTEDisolation level,Point GetandBatch Point Getoperators do not lock non-existent keys. This is a behavioral difference that can affect applications usingSELECT FOR UPDATEfor existence checks followed byINSERT.Which TiDB version(s) do your changes apply to? (Required)
What is the related PR or file link(s)?
Do your changes match any of the following descriptions?
Verification
This behavior was verified on TiDB v8.5.3:
id = 999id = 888id IN (777, 888)id BETWEEN 100 AND 200A test script was provided in the PR comments for reviewers to verify the behavior locally.