Skip to content

Fix lazy remote source for table functions with use_delayed_remote_source - #106470

Merged
evillique merged 5 commits into
ClickHouse:masterfrom
evillique:fix-lazy-remote-source-table-function
Jun 12, 2026
Merged

evillique merged 5 commits into
ClickHouse:masterfrom
evillique:fix-lazy-remote-source-table-function

Conversation

@evillique

@evillique evillique commented Jun 4, 2026 •

Copy link
Copy Markdown
Member

Fixes UNKNOWN_TABLE: Both table name and UUID are empty when building the pipeline for a distributed query over a table function (e.g. remote(..., numbers(...))) with the use_delayed_remote_source failpoint active. ReadFromRemote::addLazyPipe resolved the main-table StorageID unconditionally, but a table function has an empty main table; the resolved storage is only used by the stale-replica branch (skipped under the failpoint), so it is now skipped for table functions, mirroring the existing guard in addPipe.

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

...

Version info

  • Merged into: 26.6.1.722

@clickhouse-gh

clickhouse-gh Bot commented Jun 4, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [c829f6d]

Summary: ✅


AI Review

Summary
  • This PR makes lazy ReadFromRemote table-function shards skip main-table StorageID resolution and stale-local-replica handling under use_delayed_remote_source, matching the fact that table functions do not have local table storage. The added stateless regression covers the failpoint-forced DelayedSource path. I did not find any new correctness, safety, or test-coverage findings; the prior bot-authored inline finding is fixed in the current code.
Final Verdict
  • Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Jun 4, 2026
@thevar1able thevar1able self-assigned this Jun 10, 2026
@clickhouse-gh

clickhouse-gh Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 84.60% 84.60% +0.00%
Functions 92.30% 92.30% +0.00%
Branches 77.30% 77.20% -0.10%

Changed lines: Changed C/C++ lines covered by tests: 11/13 (84.62%) | Lost baseline coverage: none · Uncovered code

Full report · Diff report

@clickhouse-gh

clickhouse-gh Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

📊 Cloud Performance Report

🔴 AI verdict: degradation — 13 regressed, 5 improved out of 38 analysed

13 regressed query(s). K_source=6 K_base=30 flagged=18/65

clickbench

🔴 12 regressed · 🟢 2 improved

Flagged queries (14 of 43)
Query Verdict Baseline med (ms) PR med (ms) Change q-value Hint
🔴 9 regression 373 426 +14.2% <0.0001
🔴 12 regression 325 363 +11.7% <0.0001
🔴 13 regression 497 617 +24.1% <0.0001
🔴 14 regression 385 434 +12.7% <0.0001
🔴 16 regression 796 1026 +28.9% <0.0001
🔴 17 regression 564 692 +22.5% <0.0001
🔴 18 regression 1403 1769 +26.1% <0.0001
🔴 31 regression 310 373 +20.3% <0.0001
🔴 32 regression 1367 2207 +61.5% <0.0001
🔴 33 regression 1488 1790 +20.3% <0.0001
🔴 34 regression 1486 1799 +21.1% <0.0001
🔴 35 regression 176 206 +17.1% <0.0001
🟢 22 improvement 334 264 -21.0% <0.0001
🟢 23 improvement 297 206 -30.6% <0.0001

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

🔴 1 regressed · 🟢 3 improved

Flagged queries (4 of 22)
Query Verdict Baseline med (ms) PR med (ms) Change q-value Hint
🔴 8 regression 156 183 +17.7% <0.0001
🟢 4 improvement 3015 2204 -26.9% 0.0057
🟢 7 improvement 113 73 -35.4% <0.0001
🟢 20 improvement 248 126 -49.2% <0.0001

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.

Debug info
  • StressHouse run: 4a2f664d-0f87-48c2-9758-ac7f5d4ee1aa
  • MIRAI run: c552dadc-f7ba-447c-9242-5bd243a5e1a4
  • PR check IDs:
    • clickbench_390174_1781280483
    • clickbench_390187_1781280482
    • clickbench_390193_1781280483
    • tpch_adapted_1_official_390199_1781280483
    • tpch_adapted_1_official_390211_1781280482
    • tpch_adapted_1_official_390222_1781280482

@evillique
evillique added this pull request to the merge queue Jun 12, 2026
Merged via the queue into ClickHouse:master with commit 83ec0f0 Jun 12, 2026
166 checks passed
@evillique
evillique deleted the fix-lazy-remote-source-table-function branch June 12, 2026 18:54
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants