TiFlash: Handle duplicate MPP task dispatch, ignore "task is already registered"
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
## Enhancement: Ignore TiFlash MPP dispatch "task is already registered" (idempotent success)
### Motivation
In MPP execution, TiDB dispatches tasks to TiFlash. In some cases (e.g. coordinator retry caused by RPC timeout / transient network issues), TiDB may dispatch the same MPP task more than once. TiFlash can then return an error message like **"task is already registered"**.
Today this can cause TiDB to treat the dispatch as failed and abort the whole query, even though the task is already accepted and running on TiFlash.
### What we want
Treat **"task is already registered"** from TiFlash dispatch response as **idempotent success**:
- Do not fail the query for this specific case.
- Emit a warning log to help diagnose unexpected duplicate dispatches.
- Keep other errors unchanged (still returned as before).
### Scope
- Only affects handling of TiFlash MPP dispatch responses.
- No new retry/cancel behavior is introduced.
### Acceptance criteria
- Queries do not fail when TiFlash replies "task is already registered" during MPP task dispatch.
- Warning log is emitted when this path is taken.
Contributor guide
Assessment
This issue has not been assessed yet.