tikv: check nil response of split region (#472)

Signed-off-by: disksing <i@disksing.com>
This commit is contained in:
disksing 2022-04-14 18:45:45 +08:00 committed by GitHub
parent aeec0c030d
commit 45f7e566b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -144,6 +144,13 @@ func (s *KVStore) batchSendSingleRegion(bo *Backoffer, batch kvrpc.Batch, scatte
resp.Header.Error = &pdpb.Error{Message: err.Error()}
return resp
}
if resp == nil {
return &pdpb.SplitRegionsResponse{
Header: &pdpb.ResponseHeader{
Error: &pdpb.Error{Message: "empty response"},
},
}
}
regionIDs := resp.GetRegionsId()
if len(regionIDs) > 0 {
// Divide a region into n, one of them may not need to be scattered,