Skip to content

Sync BlobKiller Adaptive Scaling - #110817

Merged
Michicosun merged 2 commits into
masterfrom
blob-killer-adaptive-scaling
Jul 17, 2026
Merged

Michicosun merged 2 commits into
masterfrom
blob-killer-adaptive-scaling

Conversation

@Michicosun

@Michicosun Michicosun commented Jul 17, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

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

This pr adds adaptive scaling to the BlobKiller infrastructure.

Version info

  • Merged into: 26.7.1.1114 (included in 26.7 and later)

@clickhouse-gh

clickhouse-gh Bot commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [4cccdc9]

Summary: ✅


AI Review

Summary

This PR adds adaptive BlobKiller scaling, exports dead/missing blob queue metrics, and starts using dead-blob queue pressure in MergeTree insert throttling. The direction makes sense, but the current implementation misses supported wrapped-disk configurations, so the new throttling and observability paths diverge in ways that will hide or bypass the very backlog they are meant to surface.

Findings

⚠️ Majors

  • [src/Storages/MergeTree/MergeTreeData.cpp:6624] dead_blobs_to_delay_insert / dead_blobs_to_throw_insert only unwrap a single delegate disk before casting to DiskObjectStorage. The repository already ships a double-encrypted object-storage policy (s3_no_cache_encrypted_double), so for that supported configuration the cast never succeeds and dead_blobs_count remains 0, silently disabling the new backpressure. Suggested fix: unwrap delegates in a loop (or reuse the existing recursive helper) before traversing the DiskObjectStorage cache chain.

  • [src/Interpreters/ServerAsynchronousMetrics.cpp:375] The new queue metrics only handle direct DiskObjectStorage instances. Encrypted object-storage disks therefore expose no metrics at all, and cached/multi-cache disks only expose the outer layer instead of the full wrapped queue that the insert-throttling path uses. Suggested fix: collect these metrics after recursively unwrapping delegate disks and then aggregate across the wrapped DiskObjectStorage chain, so the exported counters match the backlog that actually gates inserts.

Final Verdict
  • Status: ⚠️ Request changes

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Jul 17, 2026
@Michicosun

Copy link
Copy Markdown
Member Author

No need to review. Changes were reviewed in the private repo.

@clickhouse-gh

clickhouse-gh Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

📊 Cloud Performance Report

✅ AI verdict: no_change — no significant changes across 37 queries analysed

This PR changes only insert-delay throttling (a new dead-blobs-queue insert gate), background blob-cleanup batching/threading, and a thread-safety fix in a background delay helper plus a new async metric — none of which touch SELECT query execution. All five flagged deltas are consistent with that: the four small ClickBench improvements (Q4, Q28, Q32, Q34) and the ~+5.7% swing on TPC-H Q4 all fall within master's current variance bands or come from noisy queries. The envelope-suppressed rows were sanity-checked against the diff and are consistent; no delta can be concretely attributed to the changed code, so the no_change/not_sure verdicts stand.

clickbench

⚠️ 1 inconclusive

Flagged queries (1 of 43)
Query Verdict Baseline median (ms) PR median (ms) Change q-value Hint
⚠️ 28 not_sure 1071 1014 -5.3% <0.0001 Query has a noisy history and the two tests disagree, so not_sure is right. Nothing in this insert/blob-cleanup PR touches this query's execution path.

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

⚠️ 1 inconclusive

Flagged queries (1 of 22)
Query Verdict Baseline median (ms) PR median (ms) Change q-value Hint
⚠️ 4 not_sure 1026 1084 +5.7% <0.0001 The +5.7% is a noisy query whose median (1084 ms) stays within master's band [986-1095 ms], and the PR changes only insert throttling and background cleanup, so not_sure is correct.

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.

Debug info
  • StressHouse run: 54b16956-99c9-4ac8-a5f7-39860b72f1c0
  • MIRAI run: 4fcbedc0-8e23-40bb-ab0a-e4aa114c5b81
  • PR check IDs:
    • clickbench_56077_1784293721
    • clickbench_56083_1784293721
    • clickbench_56090_1784293721
    • tpch_adapted_1_official_56100_1784293721
    • tpch_adapted_1_official_56111_1784293721
    • tpch_adapted_1_official_56125_1784293721

@clickhouse-gh

clickhouse-gh Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 50.20% 86.00% +35.80%
Functions 58.50% 91.80% +33.30%
Branches 38.90% 78.20% +39.30%

Changed lines: Changed C/C++ lines covered: 138/160 (86.25%) · Uncovered code

Full report · Diff report

@Michicosun
Michicosun enabled auto-merge July 17, 2026 14:53
@Michicosun
Michicosun added this pull request to the merge queue Jul 17, 2026
Merged via the queue into master with commit 918f32f Jul 17, 2026
178 checks passed
@Michicosun
Michicosun deleted the blob-killer-adaptive-scaling branch July 17, 2026 16:12
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Jul 17, 2026
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
…tive-scaling

Sync `BlobKiller` Adaptive Scaling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-not-for-changelog This PR should not be mentioned in the changelog 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.

2 participants