storage: fix wrong commit_ts in Get/TableScan when latest write is Op_Lock (#19374) (#19394)#19397
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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 |
…_Lock (tikv#19374) close tikv#19312 storage: fix wrong commit_ts in Get/TableScan when latest write is Op_Lock Problem Summary: - When `load_commit_ts=true` and a key has newer committed `Op_Lock` versions on top of the visible `Op_Put`, TiKV may return the lock commit_ts instead of the put commit_ts. What changed: - Fix `PointGetter` to return the commit_ts of the actual write version loaded by `last_change` shortcut, instead of the current cursor version. - Fix backward scanner to only update `loaded_commit_ts` when selecting a `Put` version, avoiding ts overwrite from `Lock/Rollback` versions. Tests: - Add `test_point_get_load_commit_ts_with_top_lock_versions` in `point_getter.rs`. - Add `test_load_commit_ts_with_top_lock_versions` in `scanner/backward.rs`. - Verify existing related tests: - `test_point_get_load_commit_ts` - `test_scan_with_load_commit_ts` Signed-off-by: Chao Wang <cclcwangchao@hotmail.com>
475bea7 to
4060f1d
Compare
|
@lcwangchao: adding LGTM is restricted to approvers and reviewers in OWNERS files. DetailsIn response to this: Instructions 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. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cfzjywxk, ekexium, lcwangchao 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 #19394
What is changed and how it works?
Issue Number: Close #19393
What's Changed:
Related changes
pingcap/docs/pingcap/docs-cn:Check List
Tests
Side effects
Release note
Summary by CodeRabbit
New Features
Bug Fixes
Tests