coprocessor: fix the indexlookup push down local lookup range may exceeds the region end#19216
Conversation
|
Hi @lcwangchao. Thanks for your PR. I'm waiting for a tikv 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. |
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug in the index lookup executor where local lookup ranges may exceed the region end boundary. The issue occurs because integer handles use convert_to_prefix_next to calculate the point-get range end, which can exceed the region end. The fix ensures that when the region end is used to cap the range, it is properly decoded from MVCC format to raw format before being assigned to the key range.
Key changes:
- Decode region end keys from MVCC format to raw format before using them in TableTask key ranges
- Add error handling for decoding failures with fallback to TiDB-side lookup
- Update documentation to clarify that TableTask key ranges contain raw keys without MVCC encoding
- Update tests to properly decode region end keys when constructing expected ranges
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…eeds the region end Signed-off-by: Chao Wang <cclcwangchao@hotmail.com>
3340d96 to
daf126b
Compare
|
/ok-to-test |
|
/affect 8.5 |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cfzjywxk, crazycs520 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 |
[LGTM Timeline notifier]Timeline:
|
|
/cherry-pick release-8.5 |
|
@lcwangchao: new pull request created to branch 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 ti-community-infra/tichi repository. |
…eeds the region end (#19216) (#19218) close #19215 The int handle will use the `convert_to_prefix_next` as the end of the point-get range. However, the prefix next may exceeds the region end. In the previous implementation, at this time we use the region end as the table scan range end. However, the region range end is in MVCC format, we must decode it to raw format first. Signed-off-by: Chao Wang <cclcwangchao@hotmail.com>
…eeds the region end (tikv#19216) (tikv#4165) * coprocessor: fix the indexlookup push down local lookup range may exceeds the region end (tikv#19216) close tikv#19215 The int handle will use the `convert_to_prefix_next` as the end of the point-get range. However, the prefix next may exceeds the region end. In the previous implementation, at this time we use the region end as the table scan range end. However, the region range end is in MVCC format, we must decode it to raw format first. Signed-off-by: Chao Wang <cclcwangchao@hotmail.com> Signed-off-by: crazycs520 <crazycs520@gmail.com> * format Signed-off-by: crazycs520 <crazycs520@gmail.com> --------- Signed-off-by: Chao Wang <cclcwangchao@hotmail.com> Signed-off-by: crazycs520 <crazycs520@gmail.com>
What is changed and how it works?
Issue Number: Close #19215
What's Changed:
Related changes
pingcap/docs/pingcap/docs-cn:Check List
Tests
Side effects
Release note