Skip to content

Allowlist benign encrypted Backup-engine restore error in upgrade check - #109042

Merged
alexey-milovidov merged 14 commits into
ClickHouse:masterfrom
groeneai:fix-upgrade-check-backup-encrypted-and-throwif-leaks
Aug 12, 2026
Merged

alexey-milovidov merged 14 commits into
ClickHouse:masterfrom
groeneai:fix-upgrade-check-backup-encrypted-and-throwif-leaks

Conversation

@groeneai

@groeneai groeneai commented Jul 1, 2026 •

Copy link
Copy Markdown
Collaborator

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

...

Description

03279_database_backup_database_disk_engine creates CREATE DATABASE ..._inner_backup_database ENGINE = Backup(...) and drops it, but the upgrade check runs the client with --fake-drop (DROP queries are ignored), so the database survives into the upgrade restart. When the upgrade run randomly enables --encrypted-storage, the backed-up parts are encrypted; on restart the Backup engine reads them through DiskBackup (a non-encrypted virtual disk), so BackupImpl::readFileImpl rejects the encrypted files with CANNOT_RESTORE_TO_NONENCRYPTED_DISK (Code 697), logged as a broken part plus a follow-up Detaching broken part ... backward incompatibility line. These <Error> lines then fail the "Error message in clickhouse-server.log" upgrade check.

This is expected behavior: an encrypted backup stores already-encrypted bytes and does not hold the disk key, so it can only be read back on an encrypted disk. The Backup database engine does not support encrypted backups. No crash, no data loss, no backward incompatibility.

Allow-listed with two narrow regexes in the secondary grep -av pipe that require the _inner_backup_database context together with the specific message, so other broken-part errors are not masked. Validated against the real upgrade-check server log from a failing run: the 6 backup <Error> lines are filtered.

The co-occurring FUNCTION_THROW_IF_VALUE_IS_NON_ZERO mutation-retry noise on the same check is handled separately in #109009 (the two PRs edit different lines of the same pipe and are complementary).

Found on the upgrade check of PR #109011 (unrelated change): https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=109011&sha=4531517ba0a51a968862bc9d6e085733de02e91b&name_0=PR&name_1=Upgrade%20check%20%28amd_release%29

Related: #109009

Update (2026-07-27): the storage-flag plumbing this PR also carried (forwarding --s3-storage / --encrypted-storage into the previous-release clickhouse-test run, so the no-encrypted-storage tags on 03277/03279 fire) has landed on master independently in #111772, in the canonical form that mirrors the coin flip through stress.py. That half was dropped here when merging master; what remains is the benign-error allowlist only, kept as defense in depth for previous-release trees that predate the no-encrypted-storage tags (added 2025-11-21 / 2025-12-18) and for future untagged Backup-engine variants. The cleanup-line regex is keyed on the full unique test-name prefix 03277_database_backup_database_file_engine.*_restore (and backup_database for 03276/03278/03279) so real broken-part regressions on ordinary restored objects still surface.

Related: #111772

@groeneai

groeneai commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. Pulled the real failing-run upgrade server log and replayed upgrade_runner.sh's exact rg -Fav ... | grep -av ... pipeline: 231 surviving <Error> lines (225 FUNCTION_THROW_IF_VALUE_IS_NON_ZERO + 6 CANNOT_RESTORE_TO_NONENCRYPTED_DISK).
b Root cause explained? Upgrade check runs the client with --fake-drop, so 03279_database_backup_database_disk_engine's ..._inner_backup_database (ENGINE=Backup) and 04341_broken_mutation_part_log_flush's failing throwIf(1) mutation survive into the upgrade restart. With random --encrypted-storage, the Backup engine reads encrypted parts through the non-encrypted DiskBackup -> Code 697; the queued bad mutation retries -> FUNCTION_THROW_IF.... Both are expected leftover-state, not compatibility regressions.
c Fix matches root cause? Yes. Adds narrow allowlist entries in the same secondary grep -av pipe the harness already uses for this exact "benign leftover after --fake-drop restart" class (e.g. the existing PostgreSQL/wrong_metadata entries).
d Test intent preserved / new tests added? Yes. No ClickHouse test is modified or weakened; only the upgrade-check log allowlist is extended. The originating tests still run and assert exactly as before.
e Both directions demonstrated? Yes, on the real log: without the patch 231 <Error> lines survive (check FAILS); with the patch 0 survive (check PASSES).
f Fix is general across code paths? N/A (CI harness allowlist fix, not a code bug). Both variants of each leftover (the Backup broken-part line + its Detaching broken part follow-up; both the MutatePlainMergeTreeTask and wrapping MergeTreeBackgroundExecutor throwIf lines) are covered.
g Fix generalizes across inputs? N/A (CI harness allowlist fix, not a code bug).
h Backward compatible? N/A (CI harness allowlist fix, not a code bug).
i Invariants and contracts preserved? Yes. Each regex requires the originating context AND the specific message together (_inner_backup_database + the encrypted-restore text; the mutation component + the exact throwIf text), verified against the whole log to match zero lines lacking the intended error code, so genuine backup-restore / mutation-execution regressions are not masked.

Session id: cron:clickhouse-worker-slot-1:20260701-094200

@groeneai

groeneai commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator Author

cc @maxknv @leshikus — could you review this upgrade-check harness change? It allow-lists two benign leftover-state errors that survive the upgrade restart because of --fake-drop: an encrypted Backup-engine database (Code 697 CANNOT_RESTORE_TO_NONENCRYPTED_DISK) and an intentionally-failing throwIf(1) mutation (FUNCTION_THROW_IF_VALUE_IS_NON_ZERO, the #39174 class). Both regexes require the originating context plus the specific message so real regressions still surface; validated against a real failing-run log (231 error lines to 0).

@groeneai groeneai changed the title Allowlist benign backup-engine and throwIf-mutation errors in upgrade check Allowlist benign encrypted Backup-engine restore error in upgrade check Jul 1, 2026
@groeneai
groeneai force-pushed the fix-upgrade-check-backup-encrypted-and-throwif-leaks branch from 0969c84 to a10c5a6 Compare July 1, 2026 10:20
@groeneai

groeneai commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator Author

Note: I narrowed this PR to the encrypted Backup-engine restore leak only. The co-occurring FUNCTION_THROW_IF_VALUE_IS_NON_ZERO mutation-retry noise on the same check is already fixed by #109009, so I dropped those two filters here to avoid a duplicate/conflicting change. The pre-PR validation gate above still applies (a/b/e now specifically cover the 6 backup <Error> lines; the earlier 231->0 figure was the combined effect — this PR alone removes the 6 backup lines, and together with #109009 the check reaches 0).

@alexey-milovidov

Copy link
Copy Markdown
Member

@groeneai — this allowlist covers the 03279_database_backup_database_disk_engine variant (whose Backup-engine database is named ..._inner_backup_database), but its sibling 03277_database_backup_database_file_engine hits the identical benign error and is not matched: that test names its Backup-engine database <unique>_restore (restoring from the backup written under <unique>_backup), so the error lines contain no _inner_backup_database substring and slip past both new regexes.

Seen on #109006 → Upgrade check (amd_release) (report):

<Error> `03277_database_backup_database_file_engine_test_5hf915kb_restore`.test_table_2: Part data/03277_..._restore/test_table_2/all_1_1_0/ is broken and needs manual correction. Reason: Code: 697. DB::Exception: File data/03277_..._backup/test_table_2/all_1_1_0/columns.txt is encrypted in the backup, it can be restored only to an encrypted disk. (CANNOT_RESTORE_TO_NONENCRYPTED_DISK)
<Error> `03277_..._restore`.test_table_2: Detaching broken part data/03277_..._restore/test_table_2/all_1_1_0 (size: 58.92 KiB). If it happened after update, it is likely because of backward incompatibility. You need to resolve this manually

The --fake-drop + random --encrypted-storage mechanism is exactly the one you describe — 03277's DROP DATABASE ..._restore is ignored, so the Backup-engine database survives into the encrypted restart. Could you broaden the two patterns to also catch the 03277 File-engine sibling? Either add ..._restore/..._backup-scoped variants, or anchor on the inherently-benign message itself — is encrypted in the backup, it can be restored only to an encrypted disk only arises (Code 697) when a surviving Backup-engine database is re-read on a non-encrypted disk after the random --encrypted-storage restart — while keeping the Detaching broken part.*backward incompatibility line scoped to these backup-database tests. Your call on the exact regex, given your masking-avoidance rationale.

@groeneai

groeneai commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator Author

@alexey-milovidov Broadened in 6857754. Went with your option B (anchor on the benign message, not the DB name):

  • is encrypted in the backup, it can be restored only to an encrypted disk (message only). This string is emitted at exactly two sites, both the CANNOT_RESTORE_TO_NONENCRYPTED_DISK throw in BackupImpl.cpp (:913, :1039, guarded by encrypted_by_disk != read_encrypted), so it cannot mask a genuine broken-part error (those carry a different Reason:). Covers the is broken ... Reason: Code 697 and while loading part ... Code 697 line-types for both siblings and any future backup-DB test.
  • backup_database.*Detaching broken part.*backward incompatibility for the follow-up cleanup line (it does not carry the 697 message). Scoped on the backup_database token, which is a substring of the surviving Backup-engine DB name in all four backup-database tests (03276/03277/03278/03279), mirroring the existing wrong_metadata.*Detaching broken part.*backward incompatibility precedent.

Validated by replaying the exact rg -Fav ... | grep -av ... | grep -Fa "<Error>" pipeline against the real failing upgrade logs:

Upgrade log before after
#109006 (03277 file-engine, report) 6 backup <Error> 0
#109011 (03279 disk-engine) 6 backup <Error> 0

Masking check: a synthetic CHECKSUM_DOESNT_MATCH broken part (on a normal DB, and on a *backup_database* DB) plus a normal-DB Detaching ... backward incompatibility line all still survive both filters. The 03279 disk-engine case is unchanged (still 0 backup survivors). The 225 throwIf lines remaining on the #109011 log are the separate FUNCTION_THROW_IF_VALUE_IS_NON_ZERO leak owned by #109009.

@groeneai

groeneai commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator Author

Updated pre-PR validation gate (regex broadened in 6857754 per the review above):

Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. Replayed upgrade_runner.sh's exact rg -Fav ... | grep -av ... | grep -Fa "<Error>" pipeline against the real failing upgrade server logs pulled from S3: #109006 (03277 file-engine) yields 6 surviving backup <Error> lines without the fix, 0 with it; #109011 (03279 disk-engine) 6 backup lines without, 0 with.
b Root cause explained? The Backup-engine database from 03277/03279 survives the upgrade restart because the client runs with --fake-drop; when the run randomly enables --encrypted-storage the backup parts are encrypted, and on restart BackupImpl::readFileImpl rejects them on the non-encrypted DiskBackup with Code 697 (encrypted_by_disk != read_encrypted). Benign: an encrypted backup can only be restored to an encrypted disk.
c Fix matches root cause? Yes. Allowlists exactly the two benign log lines this mechanism emits (the Code 697 encrypted-restore message and the follow-up backward-incompatibility Detaching line), scoped so genuine regressions are not masked.
d Test intent preserved / new tests added? N/A (CI harness allowlist, no test/source logic changed). The upgrade check still fails on any other unexpected <Error>.
e Both directions demonstrated? Yes. Pipeline replay: 6 -> 0 surviving backup lines on both #109006 and #109011; 225 throwIf lines (owned by #109009) correctly still survive.
f Fix is general across code paths? Yes. Anchoring on the message text (2 throw sites in BackupImpl.cpp) covers every Backup-engine restore variant regardless of surviving DB name; the backup_database token covers all four backup-database tests (03276/03277/03278/03279).
g Fix generalizes across inputs? N/A (regex allowlist in a shell harness, not a code bug).
h Backward compatible? N/A (CI-only harness change; no settings/formats/behavior).
i Invariants and contracts preserved? Masking safety verified: the encrypted-restore message is emitted only at the two Code 697 sites, so real broken-part errors (different Reason:) are not masked; the Detaching filter additionally requires Detaching broken part + backward incompatibility + a backup_database DB name, mirroring the existing wrong_metadata.* precedent. Synthetic CHECKSUM_DOESNT_MATCH broken parts and a normal-DB backward-incompat Detaching line all survive.

Session id: cron:clickhouse-worker-slot-4:20260701-115900

@alexey-milovidov alexey-milovidov added the can be tested Allows running workflows for external contributors label Jul 1, 2026
@clickhouse-gh

clickhouse-gh Bot commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [7c55daf]

Summary: ✅


AI Review

Summary

This PR narrows the upgrade-check log allowlist to the specific benign encrypted-Backup-engine leftovers from the backup-database tests. I re-checked the current diff against the BackupImpl throw sites, the MergeTree broken-part log wrappers, the prior review threads, and the current green CI, and I did not find a remaining masking or harness-contract issue in the code as it stands.

Final Verdict

✅ No new findings.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Jul 1, 2026
Comment thread tests/docker_scripts/upgrade_runner.sh Resolved
@groeneai

groeneai commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator Author

CI finish ledger — 6857754

This PR touches only tests/docker_scripts/upgrade_runner.sh (an upgrade-check allowlist), so no failure below is PR-caused. Every failure has an owner (a fixing PR); only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Stress test (amd_msan) / Unexpected return type from A. Expected B. Got C (STID 3262-4259) chronic trunk logical error (27 hits / many unrelated PRs / 8 master, 30d; spans Stress + AST fuzzer + BuzzHouse + serverfuzz) #100365 (external, open)
Mergeable Check / PR rollup of the above owned via #100365

Stress test (amd_msan) report

Session id: cron:our-pr-ci-monitor:20260701-193000

groeneai and others added 2 commits July 2, 2026 11:22
03279_database_backup_database_disk_engine creates a
..._inner_backup_database database (ENGINE = Backup) and drops it, but the
upgrade check runs the client with --fake-drop (DROP queries are ignored),
so the database survives into the upgrade restart. When the upgrade run
randomly enables --encrypted-storage, the backed-up parts are encrypted; on
restart the Backup engine reads them through DiskBackup (a non-encrypted
virtual disk), so BackupImpl rejects the encrypted files with
CANNOT_RESTORE_TO_NONENCRYPTED_DISK (Code 697), logged as a broken part plus
a follow-up 'Detaching broken part ... backward incompatibility' line.

This is expected: an encrypted backup stores already-encrypted bytes and no
disk key, so it can only be read back on an encrypted disk. Allow-listed with
two narrow regexes that require the _inner_backup_database context together
with the specific message, so other broken-part errors are not masked.

The co-occurring FUNCTION_THROW_IF_VALUE_IS_NON_ZERO mutation-retry noise on
the same check is handled separately in ClickHouse#109009.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
…-engine sibling

The two allowlist regexes were anchored on the _inner_backup_database database
name, which only matches the 03279 disk-engine variant. The sibling test
03277_database_backup_database_file_engine names its Backup-engine database
<unique>_restore, so its identical benign Code 697 error lines slipped through.

Anchor the encrypted-restore filter on the inherently-benign message text
(emitted only at the two CANNOT_RESTORE_TO_NONENCRYPTED_DISK throw sites in
BackupImpl.cpp, so it cannot mask genuine broken-part errors), and scope the
Detaching-broken-part follow-up filter on the backup_database database-name
token shared by all backup-database tests (03276/03277/03278/03279).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@groeneai
groeneai force-pushed the fix-upgrade-check-backup-encrypted-and-throwif-leaks branch from 6857754 to 0df3d96 Compare July 2, 2026 11:25
@clickhouse-gh clickhouse-gh Bot added the manual approve Manual approve required to run CI label Jul 2, 2026
… test run

The upgrade check randomly enables --encrypted-storage on the server (line
110-112) but never forwards that mode to its clickhouse-test invocation, so
no-encrypted-storage-tagged tests still run in the previous-release tree under
an encrypted disk. The Backup-engine database tests (03277/03279) then leave a
surviving database behind (the client runs with --fake-drop, so their final
DROP DATABASE is ignored), and after the encrypted restart the Backup engine
re-reads its parts through a non-encrypted DiskBackup, throwing Code 697
(CANNOT_RESTORE_TO_NONENCRYPTED_DISK) as an <Error> in the server log.

Forward the encrypted mode into the test-cmd so clickhouse-test skips the
no-encrypted-storage tests, which stops the leftover encrypted-backup state at
its source. --s3-storage is passed alongside --encrypted-storage because
clickhouse-test disables encrypted storage unless object storage is also
enabled (an encrypted disk is layered on s3/azure); the upgrade server is
always started with --s3-storage, so this matches the actual configuration.

The benign-error allowlist added earlier in this PR is kept as defense in
depth: it still covers previous-release versions that predate the
no-encrypted-storage tags and any future untagged Backup-engine variant.

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

groeneai commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator Author

Updated pre-PR validation gate — the fix now includes a root-cause harness change in d1125b6 (thread the encrypted-storage mode into the previous-release clickhouse-test run) on top of the benign-error allowlist, addressing the review above.

Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. The leak is deterministic when the upgrade coin flip enables --encrypted-storage: the no-encrypted-storage-tagged Backup-engine tests (03277/03279) run under an encrypted disk, --fake-drop skips their DROP DATABASE, and the encrypted restart re-reads the surviving Backup DB on a non-encrypted DiskBackup -> Code 697 (CANNOT_RESTORE_TO_NONENCRYPTED_DISK). Reproduced against the real failing upgrade logs (PR #109006 sha bb058ae, PR #109011 sha 4531517).
b Root cause explained? Yes. upgrade_runner.sh sets --encrypted-storage on the SERVER (line 110-112) but never forwards the mode to its stress ... --upgrade-check -> clickhouse-test invocation (line 128). So clickhouse-test never skips the no-encrypted-storage backup tests, they run in an unsupported mode, and leave encrypted-backup state that fails to restore after the encrypted restart.
c Fix matches root cause? Yes. The primary fix forwards the encrypted-storage mode into the previous-release clickhouse-test run so those tests are skipped at the source (the leftover state is never created). --s3-storage is forwarded alongside --encrypted-storage because clickhouse-test:6828 disables encrypted storage unless object storage is also enabled; the upgrade server is always on --s3-storage. The benign-error allowlist is kept as defense in depth (previous-release versions predating the tags + future untagged variants).
d Test intent preserved / new tests added? Yes. No test assertions weakened. The no-encrypted-storage tests are skipped only in the previous-release upgrade tree when the run is encrypted (exactly where they are unsupported); they still run in non-encrypted upgrade runs and across the full functional-test matrix. This is a CI-harness change, so no product regression test applies.
e Both directions demonstrated? Yes. Simulated the full upgrade_runner.sh -> stress.py command assembly -> clickhouse-test gate/skip pipeline: encrypted run -> --s3-storage --encrypted-storage reaches clickhouse-test -> 03277/03279 SKIP -> no leftover DB -> no Code 697. Non-encrypted run -> no flags -> tests RUN -> non-encrypted server restores fine -> no leak. Without the fix (flag dropped) the tests run and leak; with the fix they skip.
f Fix is general across code paths? Yes. The single missing-forward site is the upgrade runner's stress ... --upgrade-check invocation. The fix is applied there. All 16 no-encrypted-storage-tagged tests (not only the 4 Backup-database ones) are now correctly skipped in encrypted upgrade runs, so sibling leak sources of the same class are covered too.
g Fix generalizes across inputs? N/A (CI-harness change, not a code bug across datatypes/wrappers). Both Backup-engine flavors (03277 file-engine _restore, 03279 disk-engine _inner_backup_database) and all other no-encrypted-storage tests are covered by the tag-based skip, independent of the surviving database name.
h Backward compatible? N/A. No product behavior, setting, or on-disk/wire format changed. Non-encrypted upgrade runs are byte-for-byte unchanged; the change is confined to the CI upgrade harness.
i Invariants and contracts preserved? Yes. --s3-storage in clickhouse-test only gates no-s3-storage/no-object-storage skips and (for non-release builds) sets no_random_settings — the upgrade job is amd_release and already passes --no-random-settings, so no behavior changes there. The server is genuinely on s3 + encrypted disk, so telling clickhouse-test --s3-storage --encrypted-storage matches the real configuration (no false claim). Masking safety of the retained allowlist re-verified: genuine broken-part regressions from unrelated tables/messages still survive the grep filters.

Session id: cron:clickhouse-worker-slot-0:20260703-064000

@alexey-milovidov alexey-milovidov self-assigned this Jul 12, 2026
Comment thread tests/docker_scripts/upgrade_runner.sh Resolved
Comment thread tests/docker_scripts/upgrade_runner.sh Resolved
…ackup-engine read path

Pass --s3-storage to clickhouse-test on every upgrade-check run (the
previous-release server is always started with --s3-storage), gating only
--encrypted-storage on the coin flip, so no-s3-storage / no-object-storage
skips fire in the non-encrypted half too.

Scope the Code 697 (CANNOT_RESTORE_TO_NONENCRYPTED_DISK) allowlist to the
MergeTree part-loader wrapper ("is broken and needs manual correction" /
"while loading part"), which the message only carries on the background
Backup-engine read path (BackupImpl::readFileImpl). The explicit
RESTORE-to-disk path (copyFileToDisk) throws it without a wrapper, so a real
encrypted-restore-to-nonencrypted regression still surfaces. The scope is
database-name-independent, covering the 03277 file-engine sibling
(DB named ..._restore) as well as 03279's ..._inner_backup_database; the
Detaching-broken-part line gains a _restore-scoped variant for 03277.

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

Copy link
Copy Markdown
Collaborator Author

Pushed 8293301 addressing the three open change requests.

03277 file-engine sibling: the new Code 697 scope keys on the MergeTree part-loader wrapper (is broken and needs manual correction / while loading part), not on the database name, so it covers 03277 (Backup DB ..._restore) as well as 03279 (..._inner_backup_database) — no per-test DB-name enumeration needed. The Detaching broken part cleanup line (which carries no 697 message) gets a _restore-scoped sibling regex alongside the existing backup_database one.

This resolves both your message-anchor suggestion and the bot's over-suppression concern at once: the wrapper only appears on the background Backup-engine read path (BackupImpl::readFileImpl), so the explicit RESTORE-to-disk path (copyFileToDisk) — a genuine encrypted-restore-to-nonencrypted regression — still surfaces.

Validated against a real failing log (PR #99736 upgrade_error_messages.txt, all 6 lines): 03279 real log fully filtered; synthetic 03277 _restore leak fully filtered; an executeQuery ... (while executing RESTORE) 697 regression survives; an unrelated backward-incompat broken-part line survives.

Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. Real failing upgrade-check log (PR #99736, Upgrade check (amd_release)); the benign 697 + Detaching lines reproduce whenever the run flips --encrypted-storage on and a backup-database test's DB survives --fake-drop.
b Root cause explained? --fake-drop keeps the Backup-engine DB alive into the upgrade restart; with --encrypted-storage its parts are encrypted, so the MergeTree loader reading them through the Backup engine's non-encrypted DiskBackup hits Code 697. Separately, the server always runs --s3-storage but the prior diff only forwarded it in the encrypted half, so no-s3-storage/no-object-storage skips didn't fire in the non-encrypted half.
c Fix matches root cause? Yes. (1) forward --s3-storage every run, gate only --encrypted-storage; (2) scope the 697 allowlist to the background-read-path part-loader wrapper.
d Test intent preserved? Yes. Still an allowlist in the "Error message in server log" upgrade check; the scope is tightened (part-loader wrapper + backup-DB-name tokens), so it masks strictly less than before.
e Demonstrated both directions? Yes. Filter applied to the real failing log removes all 6 benign lines; negative controls (explicit-RESTORE 697 regression, unrelated broken-part) survive.
f Fix general, not narrow? Yes. DB-name-independent scope covers all four backup-database tests (03276/03277/03278/03279) and any future Backup-engine restore variant, not just the one CI caught.
g Generalizes across inputs? N/A (CI-script allowlist, not a code path over typed inputs).
h Backward compatible? N/A (test-infrastructure script; no server behavior, setting, or format change).
i Invariants preserved? Yes. The "surface every real <Error>" contract of the upgrade check is preserved — the change narrows suppression to a benign leftover-state signature and leaves genuine encrypted-restore-to-nonencrypted regressions unmasked.

Session id: cron:clickhouse-worker-slot-1:20260712-021000

Comment thread tests/docker_scripts/upgrade_runner.sh Resolved
Address review: the `_restore.*Detaching broken part.*backward
incompatibility` cleanup-line allowlist was too broad. The `03277`
restore database is named `${CLICKHOUSE_TEST_UNIQUE_NAME}_restore`, and
`CLICKHOUSE_TEST_UNIQUE_NAME` embeds the test file name, so keying on the
bare `_restore` token also swallowed real backward-incompatibility
broken-part errors for ordinary restored objects created by other
previous-release tests (e.g. `${TABLE}_restored` in
`04036_backup_partition_transaction_visibility`, `t_restore_*` in
`04149_restore_settings_coverage`, `t_restore_archive_plain` in
`03831_backup_archive_to_plain_rewritable_disk`).

Key the allowlist on the full unique test-name prefix
`03277_database_backup_database_file_engine.*_restore` instead, so a real
upgrade regression on any of those unrelated restored tables still
surfaces in `upgrade_error_messages.txt`.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…owif-leaks

Conflict in `tests/docker_scripts/upgrade_runner.sh`: master merged ClickHouse#111772,
which forwards `--s3-storage` / `--encrypted-storage` to `clickhouse-test` in the
upgrade check — the same root-cause fix this branch carried, implemented in the
canonical way (the coin flip is mirrored into `stress.py` via `--encrypted-storage`
instead of embedding both flags in `--test-cmd`). Resolved by taking master's
plumbing and dropping this branch's now-redundant `test_opts` variant; the two are
behaviourally equivalent.

What remains unique to this branch is the benign-error allowlist for the encrypted
`Backup`-engine leftovers (Code 697 `CANNOT_RESTORE_TO_NONENCRYPTED_DISK` and the
follow-up `Detaching broken part` line), which is still needed as defense in depth
for previous-release trees that predate the `no-encrypted-storage` tags. Those
`grep -av` entries auto-merged alongside master's own additions.
@clickhouse-gh

clickhouse-gh Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 7c55daf27 with master 45ccfdfc8 (stripped binary size, per-symbol sizes and ThinLTO time; object sizes against the warmup build of c6eaf567f; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes
Binary Master PR Δ
programs/clickhouse-stripped 691.36 MiB 688.36 MiB -3.00 MiB (-0.43%)

Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction.

Compile time of recompiled translation units

6 translation units recompiled, 5 s compile time in total, 6 of them have a recent master baseline.

Job report

@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 7c55daf

CI is fully finished on this head and there is nothing to own: 175/175 check-runs completed,
0 failures, 18 jobs ran green, 157 skipped. The praktika report shows top-level status OK
and 0 dropped jobs, and every skip carries an explicit reason (102 "not affected by the
changed files and not required", 25 "no build-affecting changes", 11 "reused from cache",
6 "not labeled with 'pr-performance'", 5 "not a bug-fix PR", 4 "no tests to run", and 4 others).

The skip count is high because this PR changes only tests/docker_scripts/upgrade_runner.sh.
The jobs that actually exercise that file all ran and passed: Upgrade check (amd_release)
(0/12 failures) plus all ten Stress test flavours (amd_debug, amd_asan_ubsan, amd_tsan,
amd_msan, arm_release, arm_debug, arm_asan_ubsan, arm_asan_ubsan s3, arm_tsan, arm_msan),
each 0/4 failures, alongside Style check, Code Review and both release builds.

Session id: cron:our-pr-ci-monitor:20260811-233000

@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Aug 12, 2026
Merged via the queue into ClickHouse:master with commit 1d1c754 Aug 12, 2026
179 checks passed
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-synced-to-cloud The PR is synced to the cloud repo label Aug 12, 2026
groeneai added a commit to groeneai/ClickHouse that referenced this pull request Aug 13, 2026
master gained four Backup-engine allowlist entries (ClickHouse#109042) plus a hung-check
fix in the same two regions of tests/docker_scripts/upgrade_runner.sh that this
branch edits, so the grep pipe conflicted.

Resolved as a union: every allowlist filter master added is kept verbatim and
the FileLog entry is appended after them. Verified that all 96 -e patterns
present on master survive the resolution and that the net diff against master
is still the reviewed 1 file / +5 / -0. A side-pick would have deleted a merged
allowlist entry and re-reddened the upgrade check for someone else.

The FileLog matcher keeps its reviewed scoping to the fixture table
(`.filelog_bad_path_attach`), so a genuine bad-path error elsewhere still
surfaces.
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 manual approve Manual approve required to run CI 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