-
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
store: fix tikv_region_status error information of partitioned table #38743
store: fix tikv_region_status error information of partitioned table #38743
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
hi, @bb7133 @djshow832 @crazycs520 Could you help review this question and pr? |
store/helper/helper.go
Outdated
func newPartitionLocalIndexWithKeyRange(db *model.DBInfo, table *model.TableInfo, index *model.IndexInfo, partitionID int64) TableInfoWithKeyRange { | ||
sk, ek := tablecodec.GetTableIndexKeyRange(partitionID, index.ID) | ||
startKey := bytesKeyToHex(codec.EncodeBytes(nil, sk)) | ||
endKey := bytesKeyToHex(codec.EncodeBytes(nil, ek)) | ||
return TableInfoWithKeyRange{ | ||
&TableInfo{ | ||
DB: db, | ||
Table: table, | ||
IsIndex: true, | ||
Index: index, | ||
}, | ||
startKey, | ||
endKey, | ||
} | ||
} | ||
|
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.
how about modify newIndexWithKeyRange
function and remove newPartitionLocalIndexWithKeyRange
:
git diff
diff --git a/store/helper/helper.go b/store/helper/helper.go
index f24443433e..ee811ecbdb 100644
--- a/store/helper/helper.go
+++ b/store/helper/helper.go
@@ -653,11 +653,11 @@ func newTableWithKeyRange(db *model.DBInfo, table *model.TableInfo) TableInfoWit
// NewIndexWithKeyRange constructs TableInfoWithKeyRange for given index, it is exported only for test.
func NewIndexWithKeyRange(db *model.DBInfo, table *model.TableInfo, index *model.IndexInfo) TableInfoWithKeyRange {
- return newIndexWithKeyRange(db, table, index)
+ return newIndexWithKeyRange(db, table, index, table.ID)
}
-func newIndexWithKeyRange(db *model.DBInfo, table *model.TableInfo, index *model.IndexInfo) TableInfoWithKeyRange {
- sk, ek := tablecodec.GetTableIndexKeyRange(table.ID, index.ID)
+func newIndexWithKeyRange(db *model.DBInfo, table *model.TableInfo, index *model.IndexInfo, physicalID int64) TableInfoWithKeyRange {
+ sk, ek := tablecodec.GetTableIndexKeyRange(physicalID, index.ID)
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.
Good advice.
/assign @bb7133 @djshow832 @crazycs520 @tiancaiamao |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 7d4d36a
|
TiDB MergeCI notify🔴 Bad News! New failing [1] after this pr merged.
|
What problem does this PR solve?
Issue Number: close #38742
Problem Summary:
What is changed and how it works?
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.