Repository navigation
Report a failing distributed task's error instead of QUERY_WAS_CANCELLED - #112590
Conversation
…LLED` A failing worker task stores its exception inside `TaskTracker` but cancels the query through a plain flag, so other waiters report a bare `QUERY_WAS_CANCELLED` and leave the real reason in the server log. `DistributedQueryCancellation` carries the first failure next to the flag, so the executor and `ReadFromDistributedPlanSource` report it. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Workflow [PR], commit [fe0f8fa] Summary: ✅
AI ReviewSummaryThis PR moves distributed-plan cancellation onto a shared Final Verdict✅ No blocking findings. |
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
… section A waiter that read no failure and then loaded the flag could still report `Query was cancelled` when a task recorded its failure in between. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…buted-plan-cancellation-reason
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 87/94 (92.55%) · Uncovered code |
|
📊 Cloud Performance Report
This PR only changes cancellation/error-propagation plumbing in the distributed plan executor (the make_distributed_plan path), plus a failpoint and a test. ClickBench runs single-node and does not exercise that code, so it cannot cause a real per-query shift. The one flagged query, clickbench Q15, is correctly left as not_sure: its baseline was unstable and CPU time barely moved (2628ms to 2615ms) despite a -16.2% wall-time swing, which reads as run-to-run variance rather than a PR effect. No actionable regressions or improvements. clickbenchFlagged queries (1 of 43)
Change = percent below ×2; the ratio of medians (×N faster/slower) beyond, where percent understates the scale. q-value = BH-FDR adjusted p; smaller is stronger evidence. MIRAI flags a query when q < fdr_q (default 0.10) — the value the verdict is based on. tpch_adapted_1_official🟢 No significant changes Debug info
|
Error reporting fix for the experimental multi-stage distributed query engine (
make_distributed_plan).A failing worker task stored its exception inside
TaskTrackerbut cancelled the query through a plainshared flag. Everything else that observed the flag turned it into a bare
Code: 394 QUERY_WAS_CANCELLED,so the real reason was left in the server log only. Which error reached the client depended on timing: a
failure recorded while the initiator was still dispatching a stage lost the real error, while one arriving
during the stage wait kept it.
DistributedQueryCancellationnow carries the first failure next to the flag:DistributedQueryPlanExecutor::checkCancelledrethrows the recorded failure before falling back toQUERY_WAS_CANCELLED. This covers the task dispatch loop and the dependency wait, for both the remoteand the local executor.
ReadFromDistributedPlanSource::tryGeneraterethrows it instead of reporting end of data, so a recordedfailure cannot turn into a silently truncated result.
TaskTrackerno longer keeps its own copy of the exception, so the rule has a single implementation.The new failpoint
distributed_plan_record_failure_while_starting_tasksrecords a failure while a stage isstill being dispatched, which is the ordering a fast-failing worker task produces, and makes the test
deterministic. Without the fix the test reports
Expected server error code: 439 but got: 394.Related: #111736
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Report the error that cancelled a distributed query (
make_distributed_plan = 1) instead of a bareQUERY_WAS_CANCELLED. A failing worker task's real error was previously visible only in the server log.🤖 Generated with Claude Code