Repository navigation
Add ProfileEvents to observe distributed query plan execution - #107985
shankar-iyer merged 6 commits into
Conversation
Add DistributedPlanRemoteTasks, DistributedPlanLocalExecution and DistributedPlanHostsUsed so it is visible whether a make_distributed_plan query actually ran distributedly, and verify them in the integration test. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Workflow [PR], commit [00493f2] Summary: ❌
AI ReviewSummaryThis PR adds Missing context / blind spots
Tests
Final VerdictStatus: Minimum required action: add the focused |
|
LGTM too |
| assert events["remote_tasks"] > 0, ( | ||
| f"expected the query to run distributed, got events={events}" | ||
| ) | ||
| assert events["hosts_used"] >= 2, ( |
There was a problem hiding this comment.
DistributedPlanHostsUsed is supposed to count assigned distinct hosts, but this assertion still passes for the old getWorkerAddresses().size() implementation because this test uses three configured workers and three reader buckets, so both paths report all three hosts. Please add a focused case where configured workers outnumber assigned hosts (for example this simple scan with distributed_plan_default_reader_bucket_count = 1, then assert the exact hosts_used, or a duplicate worker-host setup) so the test would fail if the metric counts configured workers instead of assigned distinct hosts.
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered by tests: 25/26 (96.15%) | Lost baseline coverage: none · Uncovered code |
|
Waiting for private-PR CI results |
|
📊 Cloud Performance Report ✅ AI verdict: This PR only adds three ProfileEvents counters (DistributedPlanRemoteTasks/LocalExecution/HostsUsed) inside the make_distributed_plan executor, plus an integration test. ClickBench queries run as ordinary single-server queries and never enter that code path, so the diff cannot plausibly speed up Q4 (-17.56%), Q15 (-11.49%), or Q28 (-6.11%). All three flagged improvements are off-path and consistent with run-to-run variance, so they have been downgraded to not-sure rather than credited to the PR. No real performance impact is expected from this change. clickbenchFlagged queries (3 of 43)
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
|
1b22d38
Mark the suite dist_each_sequential=True. The flaky/targeted integration checks run the parallel bucket with --dist=each, so every xdist worker brings up its own full 18-node Keeper+S3 cluster of test.py concurrently (3 copies on the 61 GiB AMD_MEDIUM ASan runner), which the kernel OOM-killed (job exit 137). The new flag routes both test.py and test_concurrent.py to the looped sequential -n 1 bucket under --dist=each (one cluster at a time, repeated >=3x, so the flakiness signal is preserved) while leaving them parallel under --dist=loadfile in the ~140 normal integration jobs (one file -> one worker -> one cluster, which never OOMs). The dist_each_sequential field and force_heavy_modules_sequential routing landed in master via ClickHouse#107985; this only adds the keeper suite to TEST_CONFIGS. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…Time64 The AST fuzzer hit a UBSan signed-integer-overflow on master when an extreme DateTime64 near INT64_MIN flows into the toStartOf*Interval family (STID 1421-42cf, Stress test (amd_asan_ubsan)). toStartOfHourInterval (reached by toStartOfInterval with an N-hour unit, N > 1) computes the final result as `values.date + time` in signed Int64. findIndex clamps only the LUT index, not t itself, so for t near INT64_MIN the raw `time = t - values.date` is hugely negative and `values.date + time` underflows Int64 -- undefined behavior: runtime error: signed integer overflow: -2208988800 + -9223372034645788816 cannot be represented in type 'long' The sum is now computed in UInt64 (defined wraparound) and cast back to the signed type. For every in-range input this is byte-identical to the previous result; only inputs within a divisor of INT64_MIN -- which have no valid datetime meaning -- now wrap deterministically instead of invoking UB. The minute-interval and roundDown fast paths that exhibited the same bug class were fixed independently on master by the roundDownToMultiple helper added in PR ClickHouse#107985; this change covers the remaining hour-interval site. It is the toStartOf*Interval analogue of the subsecond fix in PR ClickHouse#105482 (toStartOfSecond/Millisecond/Microsecond in DateTimeTransforms.h). The regression test exercises the whole toStartOf*Interval family at the INT64_MIN boundary so the entire family stays UBSan-clean. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…es" (ClickHouse#105591) This reverts the merge of PR ClickHouse#105591 (commit d562138), reversing changes made to 6519f67. ClickHouse#105591 broke 02354_vector_search_rescoring on master across all build configs with a deterministic Code 44 ILLEGAL_COLUMN ("The _distance column is an internal virtual column of vector search and cannot be referenced directly"). Root cause is a base-skew semantic conflict between two PRs merged 65 minutes apart, neither of which saw the other in CI: - ClickHouse#107985 (merged 10:05 UTC) added a hard ILLEGAL_COLUMN guard in both passes of useVectorSearch.cpp, making _distance internal-only. It closed customer incident clickhouse-core-incidents#1654 and added test 02354_vector_search_incident1654 asserting the guard. - ClickHouse#105591 (merged 11:10 UTC) added a feature that deliberately supports referencing _distance directly, with test queries and reference output that expect it to succeed. The guard from ClickHouse#107985 pre-empts ClickHouse#105591's new code path, so ClickHouse#105591's own tests fail on master. Reverting ClickHouse#105591 (the later, feature PR) restores master to green while preserving the customer-incident ClickHouse#1654 guard. The product decision of whether _distance should be user-referenceable is left to the vector-search owners to reconcile and re-land. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…ery_profile_events Add ProfileEvents to observe distributed query plan execution
…es" (ClickHouse#105591) This reverts the merge of PR ClickHouse#105591 (commit d562138), reversing changes made to 6519f67. ClickHouse#105591 broke 02354_vector_search_rescoring on master across all build configs with a deterministic Code 44 ILLEGAL_COLUMN ("The _distance column is an internal virtual column of vector search and cannot be referenced directly"). Root cause is a base-skew semantic conflict between two PRs merged 65 minutes apart, neither of which saw the other in CI: - ClickHouse#107985 (merged 10:05 UTC) added a hard ILLEGAL_COLUMN guard in both passes of useVectorSearch.cpp, making _distance internal-only. It closed customer incident clickhouse-core-incidents#1654 and added test 02354_vector_search_incident1654 asserting the guard. - ClickHouse#105591 (merged 11:10 UTC) added a feature that deliberately supports referencing _distance directly, with test queries and reference output that expect it to succeed. The guard from ClickHouse#107985 pre-empts ClickHouse#105591's new code path, so ClickHouse#105591's own tests fail on master. Reverting ClickHouse#105591 (the later, feature PR) restores master to green while preserving the customer-incident ClickHouse#1654 guard. The product decision of whether _distance should be user-referenceable is left to the vector-search owners to reconcile and re-land. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Mark the suite dist_each_sequential=True. The flaky/targeted integration checks run the parallel bucket with --dist=each, so every xdist worker brings up its own full 18-node Keeper+S3 cluster of test.py concurrently (3 copies on the 61 GiB AMD_MEDIUM ASan runner), which the kernel OOM-killed (job exit 137). The new flag routes both test.py and test_concurrent.py to the looped sequential -n 1 bucket under --dist=each (one cluster at a time, repeated >=3x, so the flakiness signal is preserved) while leaving them parallel under --dist=loadfile in the ~140 normal integration jobs (one file -> one worker -> one cluster, which never OOMs). The dist_each_sequential field and force_heavy_modules_sequential routing landed in master via ClickHouse#107985; this only adds the keeper suite to TEST_CONFIGS. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Add
DistributedPlanRemoteTasks,DistributedPlanLocalExecutionandDistributedPlanHostsUsedprofile events to monitor distributed query executionChangelog category :
Changelog entry :
Added ProfileEvents
DistributedPlanRemoteTasks,DistributedPlanLocalExecution, andDistributedPlanHostsUsedto observe make_distributed_plan execution.Version info
26.7.1.236(included in26.7and later)