Skip to content
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/copr: fix building cop task for global kill #37477

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions store/copr/coprocessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,7 @@ func (c *CopClient) Send(ctx context.Context, req *kv.Request, variables interfa
tasks []*copTask
err error
)
if len(req.KeyRanges) > 0 {
ranges := NewKeyRanges(req.KeyRanges)
tasks, err = buildCopTasks(bo, c.store.GetRegionCache(), ranges, req, eventCb)
} else {
if len(req.KeyRangesWithPartition) > 0 {
// Here we build the task by partition, not directly by region.
// This is because it's possible that TiDB merge multiple small partition into one region which break some assumption.
// Keep it split by partition would be more safe.
Expand All @@ -107,6 +104,9 @@ func (c *CopClient) Send(ctx context.Context, req *kv.Request, variables interfa
}
tasks = append(tasks, tasksInPartition...)
}
} else {
ranges := NewKeyRanges(req.KeyRanges)
tasks, err = buildCopTasks(bo, c.store.GetRegionCache(), ranges, req, eventCb)
}
if err != nil {
return copErrorResponse{err}
Expand Down