Repository navigation
Fix flaky test 04011_predicate_statistics_log with small randomized index_granularity_bytes - #128769
Conversation
…arity_bytes Q6 compares `total_selectivity` across `system.predicate_statistics_log` rows. Those rows are emitted per `MergeTreeSelectProcessor`, so each one carries its own reader's selectivity. The table pins `index_granularity = 8192` but not `index_granularity_bytes`, which the runner randomizes down to 1 KiB. With 116964 the part gets 48 granules of 2083 rows and a 16-row last granule. On remote storage the read is split across readers, and under parallel replicas one reader gets only that granule and logs 1/16 = 0.06 instead of 0.03, so Q6 prints `0 1` (Stateless tests (arm_binary, ParallelReplicas, s3 storage, parallel)). Floor `index_granularity_bytes` at its engine default with a per-setting random settings limit. Granules stay 8192 rows, the shortest reader share is the 1696-row tail and rounds to 0.03 like every other share. Values above the floor are still randomized; queries and reference are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review (click to expand)Own cold review + Gate B (codex) on
|
|
Workflow [PR], commit [b5c41f6] Summary: ✅ AI ReviewSummaryReviewed PR head Final VerdictStatus: ✅ Approve |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-6:20261102-205400 |
|
cc @yariks5s, could you review this and add the |
bb247ca
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
The test
04011_predicate_statistics_lognow keeps the randomizedindex_granularity_bytesat its default or above, so the 8192-row granules its Q6 consistency check relies on are not shrunk by the runner.Description
Failing job:
Stateless tests (arm_binary, ParallelReplicas, s3 storage, parallel), https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=124859&sha=755db441f8c998cc203a5e01aed832ff2b01feac&name_0=PR&name_1=Stateless%20tests%20%28arm_binary%2C%20ParallelReplicas%2C%20s3%20storage%2C%20parallel%29 (the runner's own diagnosis: 36/36 fail with the drawn settings, 37/37 pass without, culprit--index_granularity_bytes 116964). No related open issue found.Q6 checks that
total_selectivityrounds to the same value on everysystem.predicate_statistics_logrow of the query. Those rows are emitted perMergeTreeSelectProcessor, so each one carries its own reader's selectivity. The table pinsindex_granularity = 8192but notindex_granularity_bytes, which the runner randomizes down to 1 KiB. With116964the part gets 48 granules of 2083 rows and a 16-row last granule. On remote storage the read is split across readers, and under parallel replicas one reader gets only that granule and logs 1/16 = 0.06 instead of 0.03, so Q6 prints0 1.The fix adds
Random settings limits: index_granularity_bytes=(10485760, None): the engine default as a lower bound, randomized above it. Granules stay 8192 rows, the shortest reader share is the 1696-row tail, and every share rounds to 0.03. The queries and the reference are unchanged.Validation (debug build, s3-backed server with the CI parallel-replicas profile):
index_granularity_bytes = 116964: 40/40 fail with exactly the CI diff, at bothparallel_replicas_local_planvalues;116964: the new file passes 40/40 and the loggedCREATEshows the value raised to 10485760; with the limits line misspelt it fails 40/40;Workflow [PR]
Sync PR [sync-upstream/pr/128769]
Version info
26.11.1.1244-master(included in26.11and later)