Refine CoprocessorBlockInputStream's concurrency control and abort logic.
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 1k
- Forks
- 423
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 24
Description
Enhancement
Currently, DAGStorageInterpreter::buildRemoteStreams will create max_threads CoprocessorBlockInputStream, each stream has a CoprocessorReader, and each Reader will start only one thread, each thread will handle some tasks.
When one task failed, it won't affect other tasks, it just writes an error to the data buffer. And only after the TiRemoteBlockInputStream::readImpl is called, this error will be handled and then the whole mpp-task is canceled.
We should stop the coprocessorReader's other task early to reduce the waste of resources.
Refine suggestions
- merge multi CoprocessorBlockInputStream to one.
- use CoprocessorReader's concurrency.
- when one remote read task failed (can be checked in
ResponseIter::handleTask), mark this CoprocessorReader canceled.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at DAGStorageInterpreter::buildRemoteStreams and trace how CoprocessorBlockInputStream, CoprocessorReader, and ResponseIter::handleTask coordinate remote reads. Inspect the existing cancellation and error propagation paths before deciding how the suggested stream merging and reader concurrency should interact. Done means failed remote reads cancel remaining work promptly without breaking result handling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend, databases, distributed-systems
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100