Skip to content

Allowlist the 05073 fixture's failing TTL merge in the upgrade log scan - #127731

Merged
Algunenano merged 3 commits into
ClickHouse:masterfrom
groeneai:upgrade-check-allowlist-05073-ttl-merge
Nov 6, 2026
Merged

Algunenano merged 3 commits into
ClickHouse:masterfrom
groeneai:upgrade-check-allowlist-05073-ttl-merge

Conversation

@groeneai

@groeneai groeneai commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #123953
Related: #117815

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 TTL merge that 05073_column_ttl_recompute_materialized makes fail on purpose.

Description

Upgrade check (amd_release) reds on Error message in clickhouse-server.log on unrelated PRs (#124910, #116083, #63383). Every leaked line is this error, logged by MergePlainMergeTreeTask and again by MergeTreeBackgroundExecutor:

<Error> MergeTreeBackgroundExecutor: Exception while executing background task {...::all_1_1_1}: Code: 153. DB::Exception: Division by zero: while executing 'FUNCTION intDiv(100 :: 1, x :: 0) -> intDiv(100, x) Int8 : 3': While executing TTL. (ILLEGAL_DIVISION)

The job now replays the v26.10.2.103-stable suite, which contains 05073_column_ttl_recompute_materialized. Its last table makes a TTL merge fail on purpose: a column TTL resets x to 0, and m Int32 MATERIALIZED intDiv(100, x) cannot be recomputed from it. On a stress worker with a shared --database=test_N the table outlives the test, because --fake-drop ignores its DROP. The leaked lines are the endless retry of that merge reported in #123953, logged the same way by the old and the upgraded server, so they are never a compatibility signal.

The new rg -Fav entry pins the error code, the fixture's exact expression and the TTL context, so any other failing TTL merge still reds the job. It does not fix #123953 and stays correct under any fix of it: at worst it becomes dead weight.

Validation: the job's scan, replayed over the three runs' real upgrade logs, reproduces each job's upgrade_error_messages.txt byte-for-byte on master (176/158/186 lines) and gives 0 lines with the entry. Two other red runs and one green run are unchanged, and 8 one-field variants of the line (another expression, constant, code or context) still surface.

🤖 Generated with Claude Code


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

Version info

  • Merged into: 26.11.1.1518-master (included in 26.11 and later)

groeneai and others added 2 commits October 24, 2026 12:37
The upgrade check replays the previous release's suite (v26.10.2.103-stable
since 2026-10-24), which now contains 05073_column_ttl_recompute_materialized.
Its last table makes a TTL merge fail on purpose (ILLEGAL_DIVISION in
intDiv(100, x)). On a stress worker with a shared --database=test_N the table
outlives the test, because --fake-drop ignores its DROP, and both the old and
the upgraded server retry the TTLDrop merge about twice a second, so the
post-upgrade <Error> scan goes red on unrelated PRs. Allow-list the exact
fixture error (code, expression, TTL context) in the primary rg list.

Failing jobs:
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=124910&sha=d342941c4ebbe080835046f198e3508bf53958d1&name_0=PR&name_1=Upgrade%20check%20%28amd_release%29
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=116083&sha=c0dde7e36639a813a7bee13967d12ccc74b09c75&name_0=PR&name_1=Upgrade%20check%20%28amd_release%29
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=63383&sha=d6c97d5009b810df21606ec9f88afca124fef2ee&name_0=PR&name_1=Upgrade%20check%20%28amd_release%29

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The leaked merge is retried without end on both the old and the upgraded
server because of issue ClickHouse#123953: the recompute of a MATERIALIZED column
added by ClickHouse#117815 throws inside every background TTL merge. The entry does
not fix that issue and only matches this fixture's string.

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 finding).

# Sev Finding Verdict Evidence / action
1 💡 The description said the leaked lines have two shapes but showed only one AGREE, fixed The description now names both loggers (MergePlainMergeTreeTask, MergeTreeBackgroundExecutor); both carry the allow-listed string (88/79/93 lines each in the three job files). No code change.

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

Session id: cron:clickhouse-review-slot-8:20261024-130700

@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. The job's scan, extracted mechanically from the runner, replayed over the real upgrade logs of #124910, #116083 and #63383 reproduces each job's upgrade_error_messages.txt byte-for-byte (176/158/186 lines).
b Root cause explained? The job replays the v26.10.2.103-stable suite, which has 05073_column_ttl_recompute_materialized. Its last table fails a TTL merge on purpose (intDiv(100, x) after a TTL resets x to 0). On a shared --database=test_N stress worker --fake-drop ignores its DROP, the table survives, and both servers retry the merge without end (#123953); the post-upgrade scan had no entry for it.
c Fix matches root cause? Yes for the CI signal: the job runs the previous release's frozen copy of the test, so only the runner scan reaches it. The entry pins the code, the fixture's exact expression and the TTL context, not a class. #123953 itself is a separate product bug, not fixed here.
d Test intent preserved / new tests added? No test added: test-infrastructure change, validated locally by the log replay. The scan still reports every other <Error> line.
e Both directions demonstrated? Master scan 176/158/186 lines, with the entry 0/0/0 on the same logs.
f Fix is general across code paths? Both leaked shapes (MergePlainMergeTreeTask::executeStep() and MergeTreeBackgroundExecutor) carry the entry. No other runner has a general <Error> scan, and the upgrade check runs no replicated-database worker.
g Fix generalizes across inputs (params/datatypes/wrappers)? 8 one-field variants of both shapes (another expression, constant, code or TTL context) still surface; 2 red and 1 green real runs give identical output with and without the entry.
h Backward compatible? (maintainer-approved exception only) Yes. CI shell script only, no setting, format or compatibility surface.
i Invariants and contracts preserved? "Any other <Error> line in the post-upgrade log fails the job" holds (controls above); every rg argument line still ends in a continuation, bash -n and shellcheck -S warning are clean.

Session id: cron:clickhouse-impl-slot-5:20261024-130100

@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @fm4v, could you review this and add the can be tested label so CI runs? It adds one fixed-string entry to the upgrade check's log scan for the TTL merge that 05073_column_ttl_recompute_materialized makes fail on purpose: --fake-drop keeps its table alive in the shared stress database, and both servers retry the merge without end (#123953).

@clickhouse-gh

clickhouse-gh Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [dbf0afc]

Summary: ✅


AI Review

Summary

Adds an exact-string exclusion for the deliberate TTL merge failure in 05073_column_ttl_recompute_materialized, preventing unrelated upgrade-check failures. Reviewed head dbf0afcf8450221ec50ebbb3c270ce54e8b843e0 and all prior discussion; no actionable findings. Replaying the filter against the three cited upgrade logs removes the expected 176/158/186 fixture errors, while 16 near-match variants and an unrelated error remain visible. The underlying merge retry behavior remains tracked separately in #123953.

Final Verdict

✅ Approve — the narrowly scoped CI change has sufficient regression evidence.

@clickhouse-gh clickhouse-gh Bot added pr-ci comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). labels Oct 24, 2026
@alexey-milovidov alexey-milovidov added the can be tested Allows running workflows for external contributors label Oct 25, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 9754c72

Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
whose fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Upgrade check (amd_release) / Changed settings are not reflected in the settings changes history (see changed_settings.txt) not from this PR (it does not touch settings): v26.10.2.103-stable ships use_query_condition_cache_for_time_conditions = false after #127632, while the master this head was tested on still says its default became true in 26.10 (same 1 / 0 row on every PR since 2026-10-24 04:17Z). The fix merged at 11:26Z, after this run started #127687 (mine, merged)
Mergeable Check, PR praktika rollups of the row above #127687 (the owner of the row above)

CIDB has no other FAIL or ERROR row on this head.

Session id: cron:our-pr-ci-monitor:20261025-120005

@Algunenano

Copy link
Copy Markdown
Member

@groeneai Maybe we should fix #123953 instead? What are the alternatives?

@groeneai

groeneai commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator Author

Fixing #123953 would clear this red too, if the fix lets the TTL merge complete: the scan reads only the upgraded server's log (clickhouse-server.upgrade.log), and that server is the PR build. But the throw is deliberate: @ alexey-milovidov kept it on #117815 (#117815 (comment)) and pinned it in 05073 (OPTIMIZE ... FINAL; -- { serverError ILLEGAL_DIVISION }), because completing the merge would store an m that contradicts its expression.

Alternatives:

  1. This PR: one fixed-string entry in the upgrade log scan. Works now, needs no backport, and is inert once no previous release ships the fixture.
  2. Make 05073 leave a mergeable table: after the assertion, ALTER TABLE t_column_ttl_materialized_undefined MODIFY COLUMN m Int32 MATERIALIZED intDivOrZero(100, x) (metadata only). On today's master build OPTIMIZE FINAL then succeeds and nothing fails after a restart. But the job runs the previous release's suite (--queries=previous_release_repository/tests/queries, now v26.10.2.103-stable), so it only helps after a 26.10 backport and a new 26.10 tag.
  3. Fix Background column-TTL merge wedges forever when a dependent MATERIALIZED column throws on the reset default (regression from #117815) #123953 by containing the recompute failure (keep the stored m, as before Recompute MATERIALIZED columns when a column TTL resets their source #117815): clears this red and makes this PR unnecessary, but reverses that ruling.
  4. Fix Background column-TTL merge wedges forever when a dependent MATERIALIZED column throws on the reset default (regression from #117815) #123953 but keep the throw: reject such schemas at CREATE/ALTER (misses existing tables; the 05073 table is created by the previous release and only attached by the upgraded server), or back off a failing TTL merge (every merge of a part with an expired TTL applies it, so those parts still never merge, and each attempt still logs an <Error>). Neither clears this red.

I'd keep 1 for now. To remove the leak at its source, 2 can follow (with a 26.10 backport, after which 1 can be reverted); 3 needs @ alexey-milovidov's agreement. Tell me which you want and I'll send it as a separate PR.

@Algunenano Algunenano left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Since #123953 is already documented, let's allow this error for now and keep this PR

@Algunenano
Algunenano enabled auto-merge November 6, 2026 10:47
@clickhouse-gh clickhouse-gh Bot added the manual approve Manual approve required to run CI label Nov 6, 2026
@Algunenano
Algunenano added this pull request to the merge queue Nov 6, 2026
Merged via the queue into ClickHouse:master with commit ec94727 Nov 6, 2026
186 checks passed
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 6, 2026
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Nov 13, 2026
@robot-ch-test-poll robot-ch-test-poll added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Nov 13, 2026
clickhouse-gh Bot added a commit that referenced this pull request Nov 13, 2026
Backport #127731 to 26.10: Allowlist the 05073 fixture's failing TTL merge in the upgrade log scan
leshikus pushed a commit that referenced this pull request Nov 13, 2026
…merge in the upgrade log scan

(cherry picked from commit 546822f)
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). manual approve Manual approve required to run CI pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-ci pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR pr-synced-to-cloud The PR is synced to the cloud repo v26.10-must-backport

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Background column-TTL merge wedges forever when a dependent MATERIALIZED column throws on the reset default (regression from #117815)

6 participants