Repository navigation
Pin index_granularity_bytes in the distributed plan grouping test - #118071
Merged
Merged
Conversation
`04898_distributed_plan_grouping_function` asserts an `EXPLAIN actions = 1`
dump that contains the `Granules:` line of the `ReadFromMergeTree` step.
The table pins `index_granularity = 8192` so that the 1000 inserted rows form
a single granule, but the stateless test runner also randomizes
`index_granularity_bytes`, and the client only injects a randomized `MergeTree`
setting when the `CREATE` query does not already set it. With adaptive
granularity on, the byte budget caps the granule before the row count does and
the read splits into several granules, so the dump no longer matches the
reference:
- Granules: 1
+ Granules: 2
Set `index_granularity_bytes = 0` in the table definition as well, which turns
adaptive granularity off and makes the granule count depend on the already
pinned `index_granularity` alone.
Reproduced locally: with `--index_granularity_bytes 8829` the test fails with
the exact diff above before the change and passes after it.
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=master&sha=f73529f0361a65d042b316f1318959630f948d88&name_0=MasterCI&name_1=Stateless%20tests%20%28amd_release%2C%20parallel%2C%201%2F2%29&name_1=Stateless%20tests%20%28amd_release%2C%20parallel%2C%201%2F2%29
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Contributor
|
Workflow [PR], commit [0f4dcce] Summary: ✅ AI ReviewSummaryThis PR stabilizes Final Verdict✅ No findings. The fix targets the randomized MergeTree setting that changes the asserted |
…ptive granularity
`index_granularity_bytes = 0` disables adaptive granularity, and with a randomized
`min_bytes_for_wide_part` the server then writes a warning to stderr:
Table can't create parts with adaptive granularity, but settings min_rows_for_wide_part = 0,
min_bytes_for_wide_part = 10485760. Parts with non-adaptive granularity can be stored only in
Wide (default) format.
which made `Fast test` fail with `having stderror`:
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=118071&sha=b92162db243a49fb3e4bba5d361a1d9228aadf3e&name_0=PR&name_1=Fast%20test
#118071
Pinning `index_granularity_bytes` to the default `10485760` shields the table from the
randomization just as well - the 1000 inserted rows stay far below the byte cap, so the
`EXPLAIN` still prints a single granule - while keeping adaptive granularity on, so the
warning is not emitted.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
04898_distributed_plan_grouping_functionasserts anEXPLAIN actions = 1dump that contains theGranules:line of theReadFromMergeTreestep.The table pins
index_granularity = 8192so that the 1000 inserted rows form a single granule, but the stateless test runner also randomizesindex_granularity_bytes, and the client only injects a randomizedMergeTreesetting when theCREATEquery does not already set it (ClientBase::addMergeTreeSettings). With adaptive granularity on, the byte budget caps the granule before the row count does and the read splits into several granules, so the dump no longer matches the reference:The fix pins
index_granularity_bytesin the table definition as well, at its default value10485760. The 1000 inserted rows stay far below that byte budget, so the granule count depends on the already pinnedindex_granularityalone.An earlier revision used
index_granularity_bytes = 0instead. That also fixes the granule count, but it turns adaptive granularity off, and with a randomizedmin_bytes_for_wide_partthe server then writes a warning to stderr (Table can't create parts with adaptive granularity, but settings min_rows_for_wide_part = 0, min_bytes_for_wide_part = 10485760 ...), which failedFast testwithhaving stderror. Keeping adaptive granularity on and pinning the byte budget to its default avoids both problems.The randomized-settings diagnosis in the CI report points at the same culprit:
Reproduced locally against a server: with
--index_granularity_bytes 8829the test fails with the exact diff above before the change, and passes after it. It also still passes with no randomization.The same failure appeared on three recent runs, each with a different randomized value (
8829,2544,10873).CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=master&sha=f73529f0361a65d042b316f1318959630f948d88&name_0=MasterCI&name_1=Stateless%20tests%20%28amd_release%2C%20parallel%2C%201%2F2%29&name_1=Stateless%20tests%20%28amd_release%2C%20parallel%2C%201%2F2%29
Changelog category (leave one):
Workflow [PR]
Sync PR [sync-upstream/pr/118071]
Version info
26.9.1.1182(included in26.9and later)