Repository navigation
Upgrade check: honor storage skip tags by forwarding --s3-storage / --encrypted-storage - #111772
Conversation
…-encrypted-storage The Upgrade check configures the server with object storage as the default MergeTree policy (configure --s3-storage) and randomly enables encrypted storage, but ran clickhouse-test without --s3-storage and never forwarded --encrypted-storage. So clickhouse-test had args.s3_storage / args.encrypted_storage = False and ignored its storage skip tags (no-object-storage, no-s3-storage, no-encrypted-storage): those branches in should_skip_test fire only when the matching argument is set. Tests declared incompatible with the configured backend then ran on an unsupported one. This produced the Upgrade check (amd_release) Code 27 / Code 246 failures on the four 04063/04241/04417/04500_part_loading_tree_rollback_* tests (all tagged no-object-storage): they fabricate a raw plaintext txn_version.txt in a part directory (valid only on a local disk), which is unreadable on an object-storage disk, so PartLoadingTree::add (from ClickHouse#100992) reports CORRUPTED_DATA at the test's own ATTACH. With --upgrade-check (which implies --fake-drop) the corrupt part survives into the new server, which logs the parse error at part load. ClickHouse#111055 / ClickHouse#111661 hardened these tests on master, but the Upgrade check runs the frozen previous-release test suite, so those changes cannot reach it. Forward --s3-storage (in the clickhouse-test command) and --encrypted-storage (mirroring the coin flip, via stress.py) so clickhouse-test matches the server's actual configuration and skips incompatible tests, as the regular stress runner already does. Related: ClickHouse#111053 Co-Authored-By: Claude Opus 4.8 <[email protected]>
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-author-slot-5:20260724-095100 |
Internal second-model review — adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 2 findings across the initial pass + delta recheck; bounded: 1 full pass + 1 fix round + 1 delta recheck).
Severity: ❌ blocker / Session id: cron:clickhouse-author-slot-5:20260724-095100 |
|
cc @leshikus - could you review? The Upgrade check configures the server object-storage-default but ran clickhouse-test without --s3-storage (and never forwarded --encrypted-storage), so no-object-storage/no-encrypted-storage tests ran on an unsupported backend. This forwards both flags in tests/docker_scripts/upgrade_runner.sh so those tests are skipped, fixing the Code 27 txn_version.txt failures reported on #110607 and #110084. |
|
Workflow [PR], commit [ca6cc81] Summary: ✅ AI ReviewSummaryThis PR makes the Upgrade check pass the actual storage backend into Final VerdictStatus: ✅ Approve |
…eck-honor-object-storage-tags
CI finish ledger — 0dc9d1eThe Upgrade check (amd_release) target of this PR (the Two remaining reds, neither PR-caused (this PR touches only
I merged current master (@ ca6cc81) to pick up #111703, which resolves the Session id: cron:our-pr-ci-monitor:20260725-020000 |
…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.
Pulls in the `Upgrade check` fix #111772 (forward `--s3-storage` so the `part_loading_tree_rollback` tests honor their storage skip tags), which accounts for the `Upgrade check (amd_release)` red on the previous head.
…ata-bin-leak One conflict, in tests/docker_scripts/upgrade_runner.sh: the master side is ClickHouse#111772, which forwards --s3-storage and --encrypted-storage on the same `stress` invocation this branch adds --skip-func-tests to. Resolved keep-both: master's quoted --test-cmd (with --s3-storage) and its --encrypted-storage coin flip are retained verbatim, --skip-func-tests "--skip 02255_..." is added, and both comment blocks are kept because they explain different things (storage-tag forwarding vs. why the skip must live in the runner rather than the test file). ClickHouse#111772 does not supersede the skip: the previous-release copy of 02255_broken_parts_chain_on_start.sh is tagged only long, zookeeper, no-shared-merge-tree, so forwarding the storage flags does not skip it.
The five part_loading_tree_rollback tests (04063/04241/04417/04500/04624) fabricate MergeTree parts out-of-band with a raw plaintext txn_version.txt and remove them via a path derived from the `default` disk. Both steps only work when the table lives on the local default disk, but harnesses that set an object-storage default MergeTree policy without passing --s3-storage to clickhouse-test (the Stress check, and the Upgrade check before ClickHouse#111772) run these tests anyway: the raw fixture file does not parse as object-storage metadata (Code 27 -> CORRUPTED_DATA on attach), and the uuid-based recovery rm -rf misses the real data path. Pinning storage_policy = 'default' makes the fixture and the recovery path correct on any server default policy and restores the tests' intended coverage on object-storage-default Stress runs. Related: ClickHouse#111053
…zure-blob-storage stress_runner.sh ran stress.py without --test-cmd, so stress.py used its default /usr/bin/clickhouse-test (ci/jobs/scripts/stress/stress.py:714) and clickhouse-test was never told which storage backend the server actually uses. Its storage skip tags are gated on exactly that knowledge (tests/clickhouse-test:2985-3001 requires args.s3_storage / args.azure_blob_storage, set only by the --s3-storage / --azure-blob-storage flags), so no-object-storage (150 tests), no-s3-storage (36) and no-azure-blob-storage (53) were inert in every Stress run. The two fields are read by separate gates and the runner draws one backend, so an s3 run should skip 177 of them (150 + 36, 9 carry both) and an azure run 203 (150 + 53, no overlap). A fourth gate exists for no-object-storage-with-slow-build, but no test carries that tag today. Meanwhile stress_runner.sh:103-121 puts the server on object storage even for a flavour whose check name mentions neither s3 nor azure, via random=$((RANDOM % 3)): 1 selects s3_cache and exports USE_S3_STORAGE_FOR_MERGE_TREE=1, 2 selects azure_cache. So 2 of 3 runs of a "non-s3" flavour are object-storage runs, which is why the failures below are mostly on flavours with no s3 in the name. 04630_merge_over_stale_packed_tmp_dir carries no-object-storage because it copies a live part directory with a shell cp -r to simulate an interrupted merge. On an object-storage disk those files are metadata whose blob reference count lives inside the metadata file (DiskObjectStorageMetadata.h:24) and is bumped only by ClickHouse's own hardlink path (MetadataStorageFromDiskTransactionOperations.cpp:370), so the copy claims ref_count == 0. When the merge legitimately reclaims that leftover (MergeTreeData::reclaimStaleTemporaryPartDirectory -> removeSharedRecursive), the unlink decides blob deletion from that stale count and deletes the remote blob still referenced by the live active part all_1_1_0. The merge, OPTIMIZE, three SELECTs and CHECK TABLE then all fail on that one key, which is what the harness reports as "S3_ERROR No such key thrown". Measured over 14 days: 10 rows across 10 unrelated PRs, all on S3 (cached_s3 / cached_s3_encrypted), 5 Stress flavours, 0 on master. Forward the backend the runner already chose, at the one place that knows it. Same shape as the sibling upgrade_runner.sh:134 (ClickHouse#111772), generalized only where it must be: upgrade_runner hardcodes --s3-storage because it hardcodes the policy, while stress_runner picks s3 or azure at runtime, so the flag follows the environment. When neither variable is set the composed command is byte-identical to stress.py's own default, so local-policy runs are unchanged. Validated with MinIO against an object-storage default MergeTree policy: without the flag the test runs and FAILs 3/3; with --s3-storage it is SKIPPED (reason object-storage) 3/3 with zero no-such-key errors in the server log; and on the local default policy it PASSes 3/3, which shows the fixture reaches the deletion path only on object storage. The composed --test-cmd was asserted in all three environment states, and stress.py was confirmed to forward the flag into both the smoke and the stress commands of every worker. Two intended consequences of making the tags effective: a Stress run that draws object storage now SKIPs the tests declared incompatible with that backend instead of silently mis-running them, so its test count drops by up to 177 on an s3 draw and 203 on an azure draw; and only amd_debug / arm_debug runs that draw s3 lose settings randomization (tests/clickhouse-test:5828), because every sanitizer and release flavour builds with CMAKE_BUILD_TYPE=None, which CMakeLists.txt:67-69 rewrites to RelWithDebInfo and clickhouse-test maps to BuildFlags.RELEASE. That combination is already shipped and accepted for Stateless tests (amd_debug, ..., s3 storage, ...). Additionally --encrypted-storage, today silently disabled in this path by tests/clickhouse-test:7135 because no storage flag is passed, starts taking effect. Related: ClickHouse#111053
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
The Upgrade check configures the server with object storage as the default MergeTree policy (
configure --s3-storageinupgrade_runner.sh) and randomly enables encrypted storage, but invokesclickhouse-testwithout--s3-storageand never forwards--encrypted-storage. Soclickhouse-testruns withargs.s3_storage/args.encrypted_storage = Falseand ignores its storage skip tags (no-object-storage,no-s3-storage,no-encrypted-storage) — those branches inshould_skip_testfire only when the matching argument is set. Tests that declare themselves incompatible with the configured backend then run against an unsupported one.This is what produces the
Upgrade check (amd_release)failures reported on #110607 and #110084:Reports: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=110607&sha=8533d1bba003f8bf2a7a207ed25d04b4d02bce48&name_0=PR&name_1=Upgrade%20check%20%28amd_release%29 , https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=110084&sha=028f6edefc3596c261f910f0f8f57d2ebe9d3ce7&name_0=PR&name_1=Upgrade%20check%20%28amd_release%29
The four
04063/04241/04417/04500_part_loading_tree_rollback_*tests are all taggedno-object-storage. They fabricate a raw plaintexttxn_version.txtin a part directory (valid only on a local disk). On the object-storage-default server the part-dir file must beDiskObjectStorageMetadata, so the raw file is unreadable andPartLoadingTree::add(from #100992) reportsCORRUPTED_DATA/Code: 27at the test's ownATTACH(single run, no restart).--upgrade-checkimplies--fake-drop, so the corrupt part survives into the new server, which logs the same error at part load. #111055 / #111661 hardened these tests on master, but the Upgrade check runs the frozen previous-release test suite, so those changes cannot reach it.The fix forwards
--s3-storage(in theclickhouse-testcommand) and--encrypted-storage(mirroring the coin flip, viastress.py) soclickhouse-testmatches the server's actual configuration and skips incompatible tests, exactly as the regular stress runner already does.Note: this skips storage-incompatible tests in the Upgrade check that previously ran on an unsupported backend (~130
no-object-storagetests in the previous release), which is correct since the server is object-storage-default. That is a CI coverage trade-off in your area, so please redirect if you would prefer a narrower scope.