-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Panic in split table t index
stmts
#50177
Comments
Although no stack in log, I think it's panic on https://github.com/tikv/client-go/blob/c7d29aafa7073f64555532d0d10f19714bc8e6c2/tikv/split_region.go#L201 . The returned region count is greatter than given keys numbers. |
Seems we combined two regions ( |
I think the problem is like
Modify code like this diff --git a/pkg/store/mockstore/unistore/tikv/mock_region.go b/pkg/store/mockstore/unistore/tikv/mock_region.go
index 709d4c10f2..cf209603f5 100644
--- a/pkg/store/mockstore/unistore/tikv/mock_region.go
+++ b/pkg/store/mockstore/unistore/tikv/mock_region.go
@@ -403,6 +403,13 @@ func (rm *MockRegionManager) SplitRegion(req *kvrpcpb.SplitRegionRequest) *kvrpc
}
slices.SortFunc(splitKeys, bytes.Compare)
+ if len(splitKeys) < 3 {
+ time.Sleep(time.Second * 1)
+ }
+ if len(splitKeys) > 10 {
+ time.Sleep(time.Second * 2)
+ }
+
newRegions, err := rm.splitKeys(splitKeys)
if err != nil {
return &kvrpcpb.SplitRegionResponse{RegionError: &errorpb.Error{Message: err.Error()}} and got the same panic message. |
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
https://do.pingcap.net/jenkins/blue/organizations/jenkins/pingcap%2Ftidb%2Fghpr_check/detail/ghpr_check/1090/pipeline
Related log
2. What did you expect to see? (Required)
No panic
3. What did you see instead (Required)
panic
4. What is your TiDB version? (Required)
test_logs.tar.gz
The text was updated successfully, but these errors were encountered: