Repository navigation
Allowlist benign encrypted Backup-engine restore error in upgrade check - #109042
Conversation
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-worker-slot-1:20260701-094200 |
|
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 |
0969c84 to
a10c5a6
Compare
|
Note: I narrowed this PR to the encrypted |
|
@groeneai — this allowlist covers the Seen on #109006 → The |
|
@alexey-milovidov Broadened in 6857754. Went with your option B (anchor on the benign message, not the DB name):
Validated by replaying the exact
Masking check: a synthetic |
|
Updated pre-PR validation gate (regex broadened in 6857754 per the review above): Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-worker-slot-4:20260701-115900 |
|
Workflow [PR], commit [7c55daf] Summary: ✅ AI ReviewSummaryThis PR narrows the upgrade-check log allowlist to the specific benign encrypted- Final Verdict✅ No new findings. |
CI finish ledger — 6857754This PR touches only
Session id: cron:our-pr-ci-monitor:20260701-193000 |
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]>
6857754 to
0df3d96
Compare
… 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]>
|
Updated pre-PR validation gate — the fix now includes a root-cause harness change in Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-worker-slot-0:20260703-064000 |
…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]>
|
Pushed 8293301 addressing the three open change requests. 03277 file-engine sibling: the new Code 697 scope keys on the MergeTree part-loader wrapper ( This resolves both your message-anchor suggestion and the bot's over-suppression concern at once: the wrapper only appears on the background Validated against a real failing log (PR #99736 Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-worker-slot-1:20260712-021000 |
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 # Conflicts: # tests/docker_scripts/upgrade_runner.sh
…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.
…ackup-encrypted-and-throwif-leaks
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
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 units6 translation units recompiled, 5 s compile time in total, 6 of them have a recent master baseline. |
CI finish ledger - 7c55dafCI is fully finished on this head and there is nothing to own: 175/175 check-runs completed, The skip count is high because this PR changes only Session id: cron:our-pr-ci-monitor:20260811-233000 |
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.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
03279_database_backup_database_disk_enginecreatesCREATE 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 theBackupengine reads them throughDiskBackup(a non-encrypted virtual disk), soBackupImpl::readFileImplrejects the encrypted files withCANNOT_RESTORE_TO_NONENCRYPTED_DISK(Code 697), logged as a broken part plus a follow-upDetaching broken part ... backward incompatibilityline. 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
Backupdatabase engine does not support encrypted backups. No crash, no data loss, no backward incompatibility.Allow-listed with two narrow regexes in the secondary
grep -avpipe that require the_inner_backup_databasecontext 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_ZEROmutation-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-storageinto the previous-releaseclickhouse-testrun, so theno-encrypted-storagetags on03277/03279fire) has landed onmasterindependently in #111772, in the canonical form that mirrors the coin flip throughstress.py. That half was dropped here when mergingmaster; what remains is the benign-error allowlist only, kept as defense in depth for previous-release trees that predate theno-encrypted-storagetags (added 2025-11-21 / 2025-12-18) and for future untaggedBackup-engine variants. The cleanup-line regex is keyed on the full unique test-name prefix03277_database_backup_database_file_engine.*_restore(andbackup_databasefor03276/03278/03279) so real broken-part regressions on ordinary restored objects still surface.Related: #111772