Private/issue 10444 anti dep write skew#68445
Conversation
…existent keys Add tests verifying that pessimistic RR mode correctly acquires locks on non-existent point-get keys via SELECT ... FOR UPDATE, preventing the anti-dependency cycles (G2) and write skew (A5B) reported in pingcap#10444. Unit test (mock store): - TestPessimisticForUpdateLockNonExistentKey in write_test.go RealTiKV tests: - TestG2AntiDependencyCycleForUpdate - TestA5BWriteSkewForUpdateNonExistent ref pingcap#10444
Add comprehensive Chinese language PR description documenting the anti-dependency cycle and write skew regression tests for SELECT ... FOR UPDATE on non-existent keys, including test scenarios, verification results, risk assessment, and rollback procedures. Closes pingcap#10444
…ssion tests Add comprehensive PR description following TiDB official template format with complete problem statement, solution details, testing instructions, verification results, checklist completion, and release notes. Closes pingcap#10444
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @ljluestc. Thanks for your PR. I'm waiting for a pingcap member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
|
|
Hi @ljluestc. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[FORMAT CHECKER NOTIFICATION] Notice: To remove the 📖 For more info, you can check the "Contribute Code" section in the development guide. |
What problem does this PR solve?
Issue Number: ref #10444
Problem Summary:
#10444 报告了在
SELECT ... FOR UPDATE场景下,针对不存在键可能出现反依赖环(G2)与写偏斜(A5B)异常。本 PR 的目标是补齐并发回归测试,持续验证悲观事务 + RR 下的锁行为,避免该类问题回归。
What changed and how does it work?
本次为测试增强,不涉及生产逻辑改动,主要包括:
pkg/executor/test/writetest/write_test.goTestPessimisticForUpdateLockNonExistentKeyFOR UPDATE在不存在键上仍形成正确阻塞与串行化tests/realtikvtest/txntest/isolation_test.goTestG2AntiDependencyCycleForUpdateTestA5BWriteSkewForUpdateNonExistentselect ... for update#10444 场景(包含阻塞与提交顺序)Check List
Tests
本地验证命令与结果:
go test -run TestPessimisticForUpdateLockNonExistentKey -tags=intest,deadlock ./pkg/executor/test/writetest结果:
ok github.com/pingcap/tidb/pkg/executor/test/writetest结果:
ok github.com/pingcap/tidb/tests/realtikvtest/txntest补充说明:
make bazel_prepare因 Bazel native thread / resource limit OOM 失败,属于环境资源限制,并非本次用例逻辑失败。Side effects
Documentation
Release note