Skip to content

Allowlist 02555_davengers_rename_chain upgrade-check errors - #104037

Merged
alexey-milovidov merged 1 commit into
masterfrom
allowlist-wrong-metadata-narrow
May 6, 2026
Merged

alexey-milovidov merged 1 commit into
masterfrom
allowlist-wrong-metadata-narrow

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented May 4, 2026 •

Copy link
Copy Markdown
Member

Description

PR #103917 narrowed the wrong_metadata_wide allowlist in tests/docker_scripts/upgrade_runner.sh to the specific corrupted-filename signature emitted by 02538_alter_rename_sequence after the getFileNameForRenamedColumnStream substr(0, N) bug (issue #102259, fix in PR #102689). The same bug also surfaces on 02555_davengers_rename_chain's wrong_metadata table, but with a different column/stream pair (b/ba1.bin instead of column1_renamed/column1_renamedcolumn1.bin), so the narrow regex did not catch it and the upgrade check began failing on unrelated PRs.

This PR adds a matching narrow signature for the chained-rename variant and loosens the secondary Detaching broken part regex so it covers both the narrow and wide table variants. The other two substrings of the secondary regex (Detaching broken part + backward incompatibility) keep the allowlist scoped to the same symptom.

Verified against the failing log from PR #103874:
https://s3.amazonaws.com/clickhouse-test-reports/PRs/103874/49885046aba0893d06655439d554aeac6998469e/upgrade_check_amd_release/upgrade_error_messages.txt

All six lines from that log are filtered, while synthetic unrelated errors (other tables, generic detach notices, log lines that mention the table name in passing) pass through.

Source PR with the failing run: #103874

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

...

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Version info

  • Merged into: 26.5.1.319

PR #103917 narrowed the `wrong_metadata_wide` allowlist to the specific
corrupted-filename signature emitted by `02538_alter_rename_sequence` after
the `getFileNameForRenamedColumnStream` `substr(0, N)` bug (issue #102259,
fix in PR #102689). The same bug also surfaces on
`02555_davengers_rename_chain`'s `wrong_metadata` table, but with a
different column/stream pair, so the narrow regex did not catch it and
the upgrade check began failing on unrelated PRs.

Add the matching narrow signatures:

* `No stream (ba1.bin) file checksum for column b` — the chained rename
  `a -> a1 -> b` produces `<new=b><old=a1>.bin = ba1.bin` for column `b`.
  This `<column><stream>` combination is unique to that test and that bug.
* Loosen `wrong_metadata_wide` to `wrong_metadata` in the secondary
  `Detaching broken part` regex so it matches both narrow and wide table
  variants. The other two substrings (`Detaching broken part` +
  `backward incompatibility`) keep the allowlist scoped to the same
  symptom.

Verified against the failing log
(https://s3.amazonaws.com/clickhouse-test-reports/PRs/103874/49885046aba0893d06655439d554aeac6998469e/upgrade_check_amd_release/upgrade_error_messages.txt):
all six lines are filtered, while synthetic unrelated errors (other
tables, generic detach notices, log lines that mention the table name in
passing) pass through.

Source PR with the failing run: #103874
@clickhouse-gh

clickhouse-gh Bot commented May 4, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [0ce4ea3]

Summary: ✅


AI Review

Summary

This PR updates the upgrade-check log allowlist in tests/docker_scripts/upgrade_runner.sh to cover an additional known signature of the renamed-column metadata bug from 02555_davengers_rename_chain, while keeping the filtering scoped by specific substrings. The change is narrow, consistent with the existing filtering approach, and I did not find correctness, safety, or maintainability issues in the modified logic.

ClickHouse Rules
Item Status Notes
Deletion logging ➖
Serialization versioning ➖
Core-area scrutiny ➖
No test removal ✅
Experimental gate ➖
No magic constants ✅
Backward compatibility ✅
SettingsChangesHistory.cpp ➖
PR metadata quality ✅
Safe rollout ✅
Compilation time ✅
No large/binary files ✅
Final Verdict
  • Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-ci label May 4, 2026
@alexey-milovidov
alexey-milovidov marked this pull request as draft May 5, 2026 08:48
@alexey-milovidov
alexey-milovidov marked this pull request as ready for review May 5, 2026 14:22
# the same issue: a "Detaching broken part" notice that does not contain the corrupted filename. Filtered
# via regex in the secondary pipe below to require all three substrings together, so unrelated broken-part
# detach messages are not masked.
# `No stream (ba1.bin) file checksum for column b` is the same bug observed on

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@groeneai, is this bug inherent to the old ClickHouse version (used in the upgrade check) or to master as well? If the latter, we should investigate and fix the bug.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@clickgapai, same question ^

@groeneai

groeneai commented May 6, 2026

Copy link
Copy Markdown
Collaborator

@alexey-milovidov — investigated. The bug is OLD-VERSION-ONLY. Master is correct; the allowlist in this PR is the right approach.

Evidence

1. PR #102689's fix is complete on master. src/DataTypes/Serializations/ISerialization.cpp line 454 (regular column) and line 458 (Nested column) both now use file_name.substr(name_from_escaped.size()) — the correct suffix. The buggy substr(0, name_from_escaped.size()) (which took the prefix) is gone in both paths. Caller in MutateTask.cpp:520 is the only consumer.

2. Why the corrupted filename ba1.bin is unique to the old code. Tracing 02555_davengers_rename_chain's chain a → a1 → b on the substream a:

Step Old buggy substr(0, N) New fixed substr(N)
Initial substream a a
After a → a1 "a1" + "a".substr(0,1) = a1a "a1" + "a".substr(1) = a1
After a1 → b "b" + "a1a".substr(0,2) = ba1 "b" + "a1".substr(2) = b

The buggy code accumulates the original column-name prefix across each rename in the chain. ba1.bin is exactly what the old code produces here; master's fixed code produces b.bin.

3. Empirical reproduction on master HEAD (binary built from bc39c42c..., includes #102689):

CREATE TABLE test_chain (a UInt32, b UInt32, c UInt32) ENGINE=MergeTree ORDER BY tuple()
SETTINGS min_bytes_for_wide_part=0, replace_long_file_name_to_hash=0;
INSERT INTO test_chain VALUES (1, 2, 3);
ALTER TABLE test_chain RENAME COLUMN a TO a1, RENAME COLUMN b TO b1 SETTINGS mutations_sync = 1;
ALTER TABLE test_chain RENAME COLUMN a1 TO b, RENAME COLUMN b1 TO a SETTINGS mutations_sync = 1;

After the chained rename, the part directory contains a.bin, b.bin, c.bin (correct) — no ba1.bin, no a1a.bin. columns_substreams.txt lists clean substream names (a, b, c). Subsequent INSERTs and SELECTs work normally.

4. CIDB cross-check (60 days): zero master/release-branch failures matching %ba1.bin% OR %column1_renamedcolumn1.bin%. All ~50 hits are PR-side upgrade-check runs across 30+ unrelated PRs, exactly the upgrade-flow signature: old release writes the corrupted file → master detects it on startup → "Detaching broken part … backward incompatibility".

Why the upgrade check still fires it

tests/docker_scripts/upgrade_runner.sh line 114 runs the stress test against previous_release_repository/tests/queries (the previous release's source tree, including its bug), then upgrades to master. The corrupted parts are written by the previous release; master reads them on startup and correctly detaches them. The "Detaching broken part" message is master's intended behavior for legacy on-disk corruption — not a master bug.

The allowlist in this PR is the correct approach: the column+stream pair b/ba1.bin is unique to 02555_davengers_rename_chain's wrong_metadata table (and column1_renamed/column1_renamedcolumn1.bin is unique to 02538_alter_rename_sequence's wrong_metadata_wide), so the regex remains tight. Once the fix is shipped in every supported release used by the upgrade check, the allowlist entries can be removed.

(Investigated by groeneai. session: cron:clickhouse-ci-task-worker:20260506-014500)

@alexey-milovidov
alexey-milovidov added this pull request to the merge queue May 6, 2026
@alexey-milovidov alexey-milovidov self-assigned this May 6, 2026
Merged via the queue into master with commit 1de7fc5 May 6, 2026
165 checks passed
@alexey-milovidov
alexey-milovidov deleted the allowlist-wrong-metadata-narrow branch May 6, 2026 09:01
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-ci 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.

3 participants