Skip to content

Fix reference for 03707_set_index_bad_get_null_bug on 25.8 - #102944

Closed
groeneai wants to merge 1 commit into
ClickHouse:25.8from
groeneai:groeneai-fix-03707-ref-25.8
Closed

groeneai wants to merge 1 commit into
ClickHouse:25.8from
groeneai:groeneai-fix-03707-ref-25.8

Conversation

@groeneai

Copy link
Copy Markdown
Collaborator

The backport of PR #89429 to 25.8 (PR #92409, merged 2026-03-31) cherry-picked
the test reference file from master. But master's reference uses the post-fix
indentation for Ranges: (6 spaces) produced by
ReadFromMergeTree::describeIndexes, whereas 25.8 was branched before
commit ed65cfd ("Fix indent for Ranges output in EXPLAIN indexes=1",
2025-09-23). So 25.8's C++ still emits Ranges: at the double indent
(8 spaces), consistent with every other 25.8 reference file that prints
Ranges: (e.g. 01786_explain_merge_tree.reference).

Impact

Every Stateless tests (amd_asan, distributed plan, parallel, 1/2) run on
25.8 has failed 100% (23/23 on 25.8 tip, 27/27 on 25.8 backport PRs) since
PR #92409 merged on 2026-03-31 — 50 total CI failures across 19+ backport
PRs to 25.8 in the last ~17 days. CIDB:

SELECT pull_request_number, head_ref, count() as cnt FROM default.checks
WHERE test_name = '03707_set_index_bad_get_null_bug' AND test_status='FAIL'
  AND check_start_time > now() - INTERVAL 30 DAY GROUP BY pull_request_number, head_ref;

Fix

Change the one Ranges: line in 03707_set_index_bad_get_null_bug.reference
from 6 to 8 leading spaces so it matches what 25.8's describeIndexes actually
emits. Minimal, consistent with 25.8's other references. Not backporting
ed65cfdd3fc itself because that would require regenerating many reference
files on a release branch.

Verified

  • On 25.8 describeIndexes prints prefix << indent << indent << "Ranges: "
    = 4 + 2 + 2 = 8 leading spaces.
  • On master (fixed) it prints prefix << indent << "Ranges: " = 4 + 2 = 6.
  • 25.8 sibling reference 01786_explain_merge_tree.reference already uses
    8 leading spaces for Ranges: — this PR brings 03707 in line.

Cron session: cron:clickhouse-ci-task-worker:20260417-091500

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):

Fix reference for 03707_set_index_bad_get_null_bug on 25.8 (not required for changelog).

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

The backport of PR ClickHouse#89429 to 25.8 (PR ClickHouse#92409) cherry-picked the test
reference from master, which uses the post-fix indentation for `Ranges:`
(6 spaces) produced by `ReadFromMergeTree::describeIndexes`.

However, 25.8 was branched before commit `ed65cfdd3fc` ("Fix indent for
Ranges output in EXPLAIN indexes=1", Sep 23 2025), so its C++ code still
emits `Ranges:` at the double indent (8 spaces) — consistent with the
reference in `01786_explain_merge_tree.reference` on 25.8.

Result: every `Stateless tests (amd_asan, distributed plan, parallel, 1/2)`
run on 25.8 failed after the backport merged, because actual output (8
spaces) did not match the reference (6 spaces). 23 consecutive master-
branch 25.8 runs and 27 backport-PR runs were affected since 2026-03-31.

This fixes the reference to match 25.8's C++ output (8 spaces), the
minimal fix consistent with the other 25.8 reference files that already
expect 8 spaces (e.g. `01786_explain_merge_tree.reference`).

Not a backport of Azat's `ed65cfdd3fc` because that would require
regenerating many reference files; the minimal fix is sufficient and
safer for a release branch.
@groeneai

Copy link
Copy Markdown
Collaborator Author

Pre-PR validation gate (TASK.md Phase 4 Step 9)

(a) Deterministic repro? Yes. The test fails 100% of the time (23/23) on
25.8 tip and 100% (27/27) on every 25.8 backport PR since PR #92409 merged —
CIDB confirms 50/50 failures for this test/check pair since 2026-03-31.

(b) Root cause explained? The backport of PR #89429 to 25.8 (PR #92409)
cherry-picked the test reference file from master, which uses prefix << indent << "Ranges: " (6 leading spaces). But 25.8 diverged from master at commit
8f7ea5a (2025-08-25), before Azat's indent fix ed65cfdd3fc (2025-09-23).
So 25.8's ReadFromMergeTree::describeIndexes still writes
prefix << indent << indent << "Ranges: " (8 leading spaces). The .reference
file's 6 spaces do not match 25.8's C++ 8-space output.

(c) Fix matches root cause? Yes. The fix directly aligns the
Ranges: indentation in the reference file with what 25.8's existing C++
produces — matching the sibling reference 01786_explain_merge_tree.reference
which already uses 8 spaces on 25.8.

(d) Test intent preserved? Yes. The test still verifies the same invariant
(the Bad get: has Null fix from PR #89429) — it runs the exact same EXPLAIN
query and validates identical output structure. Only the whitespace
expectation matches the 25.8 code's actual formatting.

(e) Both directions demonstrated? CIDB documents the "fails without fix"
direction exhaustively: every single 25.8 run of this test/check pair (50 in
30 days) fails with the same whitespace diff. The "passes with fix" direction
will be verified by CI after this PR merges (25.8 ReleaseBranchCI subsequently
runs the 1/2 shard).

(f) Fix is general, not a narrow patch? N/A — this isn't a code bug,
it's a release-branch reference-file drift. The general fix (backporting
ed65cfd) would regenerate ~10 reference files and risks further drift
for minimal benefit; the minimal reference-only fix is the standard pattern
for release branches.

@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @KochetovNicolai — could you review this? It fixes a whitespace mismatch between your 25.8 backport of PR #89429 (PR #92409) and 25.8's pre-indent-fix describeIndexes code, which has caused 100% failure of Stateless tests (amd_asan, distributed plan, parallel, 1/2) on 25.8 since the backport merged (50 failures / 19+ backport PRs affected in the last 17 days).

@pufit

pufit commented Apr 17, 2026

Copy link
Copy Markdown
Member

@groeneai do not try to fix flaky tests in release branches. And do not try to backport any changes manually - for that, we have a special label pr-must-backport and it is meant to be used by a human. Write it as a rule for yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants