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

Compatible batch copr with load-based replica read #42322

Closed
you06 opened this issue Mar 16, 2023 · 0 comments · Fixed by #42237
Closed

Compatible batch copr with load-based replica read #42322

you06 opened this issue Mar 16, 2023 · 0 comments · Fixed by #42237
Labels
type/enhancement The issue or PR belongs to an enhancement.

Comments

@you06
Copy link
Contributor

you06 commented Mar 16, 2023

Enhancement

We have 2 optimizations which improve the performance of distsql read, one is the batch coprocessor and another is the load-based replica read. But they are currently not compatible, because sending batched tasks to the replica store will produce region misses.

tidb/store/copr/coprocessor.go

Lines 1126 to 1132 in fa28db1

// TODO: Load-based replica read is currently not compatible with store batched tasks now.
// The batched tasks should be dispatched to their own followers, but it's not implemented yet.
// So, only enable load-based replica read when there is no batched tasks.
var busyThresholdMs uint32
if len(copReq.Tasks) == 0 {
busyThresholdMs = uint32(worker.req.StoreBusyThreshold.Milliseconds())
}

As an enhancement, the batched task should be re-split before being sent to the replica nodes. It might choose the best replica node in the coprocessor client.

@you06 you06 added the type/enhancement The issue or PR belongs to an enhancement. label Mar 16, 2023
ti-chi-bot pushed a commit that referenced this issue Mar 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant