Repository navigation
Conversation
`modernize-use-nodiscard` flags them in every translation unit that includes the header. The PR changed the header, so the clang-tidy cache no longer hid them. https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=127586&sha=141c98b0e47f6cb31f8858d2d53c64949e2e624a&name_0=PR #127586 Co-Authored-By: Claude Opus 5.5 <[email protected]>
The patch readers of a read task got no `CountedCompressedBlocks` and were never flushed, so the bytes of patch parts were missing from the input bytes of the statistics: an unmerged lightweight update could dominate the read while the statistics described only the base part. A replica reading the same granules applies the same patches, so they are counted with the read. Related: #127586 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Workflow [PR], commit [7c93f25] Summary: ❌
AI ReviewSummaryAdds patch-part reads to the compressed-byte statistics used by automatic parallel replicas. Reviewed the full diff and current reader, range-selection, cache, and cost-model paths at Missing context / blind spots
Findings
Tests
Final VerdictStatus: Correct the accounting of patch work repeated across replicas, or exclude those cases from automatic pricing, and cover that decision with a focused regression test. LLVM Coverage ReportMeasured on commit 7c93f25.
Changed lines: Changed C/C++ lines covered: 31/33 (93.94%) · Uncovered code |
| reader->countCompressedBytesRead(counted); | ||
| /// A replica reading the same granules reads their patches too. | ||
| for (auto & patch : patches) | ||
| patch->getReader()->countCompressedBytesRead(counted); |
There was a problem hiding this comment.
[Major] Keep replicated patch loads out of splittable input bytes
counted assigns these bytes to the coordinated read's input_bytes, which decideAtBoundary divides by the replica count. Patch reads do not always split with the base granules: for a v2 table with ORDER BY tuple(), getRangesInPatchPartMergeOnKey returns the entire patch for every nonempty task, and MergeTreePatchReaderMergeOnKey::needNewPatch consumes all its ranges. Each replica therefore loads the full patch, while CountedCompressedBlocks records one copy and the model prices it as patch_bytes / num_replicas. Legacy Join patches have the same issue when their min/max statistics cannot prune the shared ranges; PatchJoinCache is local to each read pool.
For patch-dominated reads this can enable replicas based on nonexistent savings and bypass automatic_parallel_replicas_max_duplicated_read_ratio. Please account for nonsplittable patch work as duplicated bytes, or decline automatic pricing for these cases. Add a focused stateless regression with a constant sorting key or a Join patch; the added test's unique sorting key and input-byte lower bound do not exercise this distinction.
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Object file sizes121 object files changed (+63.62 KiB total), 0 added.
716 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only Compile time of recompiled translation units732 translation units recompiled, 5090 s compile time in total, 732 of them have a recent master baseline. |
…reads # Conflicts: # src/Storages/MergeTree/MergeTreeReadTask.cpp
Related: #127586
Related: #133839
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
The input bytes automatic parallel replicas measure now include what the query reads from patch parts of lightweight updates, so a query whose unmerged patches dominate its read is no longer under-priced.
Stacked on #133839 (text index reads), on #133777 (the limit on the registered ranges), on #127586 (the input bytes measured as the compressed blocks the readers load); the base of this PR is the branch of #133839, so the diff shows only the patch parts.
The patch readers of a read task got no
ReadRangesRegistryand never registered what they read, so the bytes read from patch parts did not reach the input or the duplicated bytes. TheMergeTreeReadTasknow gives the registry to the patch readers with the main andPREWHEREreaders, andMergeTreeReadersChain::readPatchescallsregisterReadRangesof each one after it reads. A replica reading the same granules applies the same patches, so they are counted with the read. Patches applied inJoinmode go through thePatchJoinCacheshared within the read; the reader that loads a range counts it, once.05840_autopr_input_bytes_patch_parts: an unmergedUPDATEreplaces 100000 empty strings with payloads that hardly compress. The statistics record 3.5 MB with the change and 110 KB without it.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/133609]