Skip to content

Ignore the 05259 read-only replica fixture in the upgrade check log scan - #127843

Open
groeneai wants to merge 1 commit into
ClickHouse:masterfrom
groeneai:upgrade-check-allowlist-05259-replace-cover
Open

groeneai wants to merge 1 commit into
ClickHouse:masterfrom
groeneai:upgrade-check-allowlist-05259-replace-cover

Conversation

@groeneai

@groeneai groeneai commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #120980

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

Stop the upgrade check from failing on the read-only replica that an interrupted 05259_replace_partition_covers_outdated_parts_replicated leaves behind.

Description

Upgrade check (amd_release) reds on Error message in clickhouse-server.log on unrelated PRs (#127801, #126627). The only leaked line in each:

<Error> test_1.t_replace_cover_rep (ReplicatedMergeTreeAttachThread): Initialization failed, table will remain readonly. Error: Code: 231. DB::Exception: The local set of parts of table test_1.t_replace_cover_rep (...) doesn't look like the set of parts in ZooKeeper: 3.00 rows of 4.00 total rows in filesystem are suspicious. There are 3 uncovered unexpected parts with 3 rows (...), 0 missing parts (with 0 blocks), 0 covered unexpected parts (with 0 rows). (TOO_MANY_UNEXPECTED_DATA_PARTS)

The job replays the v26.10.2.103-stable suite. Its 05259 stops the cleanup and keeps outdated parts on purpose; after its DROP PART, only the empty part written by its REPLACE PARTITION covers them. In both runs stress worker 1 (--database=test_1, memory_tracker_fault_probability) failed that REPLACE PARTITION with an injected Code: 241, the file stopped, and --fake-drop kept the table, so every later load refuses the uncovered parts (on #126627 the old server logged the same line 10 times). A master change to the test cannot reach this job while 26.10 is the previous release.

The new matcher requires the exact table name in the attach-thread logger, the read-only branch, Code 231, 0 missing parts and TOO_MANY_UNEXPECTED_DATA_PARTS. The same error on any other table, like the real test_1.rmt bug on #121145 fixed by #122610, still reds the job.

Validation: the job's scan, replayed over both runs' upgrade logs, reproduces each upgrade_error_messages.txt byte for byte on master and gives 0 lines with the entry; #121145, two other runs and 8 one-field variants of the line are unchanged.

On #127801 the covering part was lost because MergeTreeData.cpp:8316 commits that part's storage after removePartsFromWorkingSet (:8308); not changed here.

🤖 Generated with Claude Code


Workflow [PR]
Sync PR [sync-upstream/pr/127843]

The upgrade check runs the previous release's copy of the stateless suite.
`05259_replace_partition_covers_outdated_parts_replicated` keeps outdated
parts on disk on purpose (`SYSTEM STOP CLEANUP`, `old_parts_lifetime =
100000`): its `DROP PART '1_1_1_0_2'` removes two parts from ZooKeeper with
no covering part, and the empty covering part that its `REPLACE PARTITION`
writes is the only thing that covers them on disk. Stress worker 1
(`--database=test_1`) runs with `memory_tracker_fault_probability`, so an
injected `Code: 241` can fail that `REPLACE PARTITION` (before its ZooKeeper
change, or after it, in the covering part's storage commit). The file stops
there, the cleanup stays stopped, `--fake-drop` keeps the table, and every
later load of it finds 2-3 rows in parts that ZooKeeper does not have and
nothing covers, so the attach thread refuses it:

  <Error> test_1.t_replace_cover_rep (ReplicatedMergeTreeAttachThread):
  Initialization failed, table will remain readonly. Error: Code: 231.
  DB::Exception: The local set of parts of table test_1.t_replace_cover_rep
  (...) doesn't look like the set of parts in ZooKeeper: 3.00 rows of 4.00
  total rows in filesystem are suspicious. There are 3 uncovered unexpected
  parts with 3 rows (...), 0 missing parts (with 0 blocks), 0 covered
  unexpected parts (with 0 rows). (TOO_MANY_UNEXPECTED_DATA_PARTS)

The old server gives the same table the same refusal (on PR ClickHouse#126627 it
logged the identical line 10 times before the upgrade), so it is not a
compatibility signal. A master change to 05259 cannot clear this job while
a release with the current copy of the test is the previous one, so the
entry is needed until that test no longer leaves this state behind when it
is stopped between its `DROP PART` and the end of its `REPLACE PARTITION`.

The new matcher requires the `<db>.t_replace_cover_rep` attach-thread
logger (exact table name), the read-only branch, Code 231, `0 missing parts
(with 0 blocks)` and `TOO_MANY_UNEXPECTED_DATA_PARTS` together. The same
error on any other table (a real covering-part regression, like `test_1.rmt`
on PR ClickHouse#121145, fixed by ClickHouse#122610), any other code, or a load that also
misses parts in ZooKeeper still fails the job. Seen on PR ClickHouse#127801 and PR
ClickHouse#126627 (Upgrade check (amd_release)).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@groeneai

Copy link
Copy Markdown
Collaborator Author
Internal second-model review: adjudication log (click to expand)

Pre-publication review by an independent model (engine: codex; 0 findings), plus an independent cold review of the same tree (1 nit).

# Sev Finding Verdict Evidence / action
1 💡 The runner comment names one trigger (an injected fault in REPLACE PARTITION); any stop between the DROP PART and the end of the REPLACE PARTITION leaves the same state AGREE, noted Both runs failed on exactly that statement; the matcher covers every stop point and the commit message says so. Wording only, not changed.

Severity: ❌ blocker / ⚠️ major / 💡 nit. DISAGREE verdicts carry recorded evidence and are terminal per finding.

Session id: cron:clickhouse-review-slot-8:20261026-141500

@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. The scan extracted from master's upgrade_runner.sh, replayed over each job's real clickhouse-server.upgrade.log, regenerates its upgrade_error_messages.txt byte for byte (1 line, PR #127801 and PR #126627).
b Root cause explained? An injected Code: 241 (stress worker 1, memory_tracker_fault_probability) fails the previous release's 05259 in its REPLACE PARTITION. Under SYSTEM STOP CLEANUP the table keeps parts that ZooKeeper does not have and nothing covers; --fake-drop keeps it, and the upgraded server's attach thread refuses it (Code 231, read-only).
c Fix matches root cause? The job runs the previous release's copy of the test, so the scan is the only layer this repo controls for it. The entry is scoped to this table, the read-only branch, Code 231 and the no-missing-parts shape.
d Test intent preserved / new tests added? Test-infrastructure change, so no self-test. The scan still surfaces every other line.
e Both directions demonstrated? Yes. Master: 1 line on each carrier. With the entry: 0.
f Fix is general across code paths? Same per-fixture shape as the existing 02980 and 05024 entries. No other line of this table appears in either upgraded log.
g Fix generalizes across inputs (params/datatypes/wrappers)? Another table (_src, xt_, rmt), code, error name, logger, or 1/10 missing parts all still surface. Another test_N database is matched on purpose.
h Backward compatible? (maintainer-approved exception only) N/A: no setting, format or server behaviour changes.
i Invariants and contracts preserved? The extracted pipelines differ by exactly one added grep -av stage. No run gains a line, and the real test_1.rmt bug of PR #121145 plus two other runs are unchanged.

Session id: cron:clickhouse-impl-slot-5:20261026-140600

@clickhouse-gh

clickhouse-gh Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [fb2f36a]

Summary: ✅


AI Review

Summary

Adds a scoped exclusion for the read-only t_replace_cover_rep fixture left by an interrupted 05259_replace_partition_covers_outdated_parts_replicated run. No actionable findings. Focused validation passed all 15 checks using both linked CI failure messages and variants covering other tables, loggers, error codes, and missing parts.

Missing context / blind spots
  • ⚠️ The PR's full Upgrade check (amd_release) is pending; its end-to-end result is not yet available.
Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Oct 26, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @yakov-olkhovskiy, could you review this and add the can be tested label so CI runs? It adds one scoped grep -av entry to the upgrade check log scan for the read-only t_replace_cover_rep replica that the previous release's 05259 leaves behind when an injected fault stops it mid-REPLACE PARTITION; the same Code 231 on any other table still fails the job.

This branch has not been deployed

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

Labels

can be tested Allows running workflows for external contributors comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). pr-ci

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants