Repository navigation
Conversation
`Upgrade check (amd_release)` writes two FAIL rows from one cause, seen on 2026-09-21 at https://github.com/ClickHouse/ClickHouse/actions/runs/35645002320/job/106556496138 Error message in clickhouse-server.log (see upgrade_error_messages.txt) The mutation submitted before the upgrade was not finished by the new server The pre-upgrade phase runs the PREVIOUS RELEASE's copy of the functional suite: upgrade_runner.sh:44 clones the tag and :148 points clickhouse-test at previous_release_repository/tests/queries. At v26.9.1.1629-stable, 05211_backup_log_zero_byte_data_file.sh:18 sets COLUMN="AggregateFunction(countResample(10, 5, 1), UInt64, UInt64)" and types five Log family tables with it, then restores a copy of each, so up to ten persisted tables carry it. A state of that empty `-Resample` range serializes to zero bytes and cannot be read back, so ClickHouse#119728 rejects the parameterisation; it merged as a Backward Incompatible Change whose changelog entry states the consequence outright: "a table with such a column no longer loads. Before upgrading, drop the column where the engine supports DROP COLUMN, and the whole table where it does not (Log, TinyLog, StripeLog, Set, Join, File)." The old server predates the check and accepts the CREATE; `--upgrade-check` implies `--fake-drop` (clickhouse-test:7854), so the tables survive the restart and the new binary correctly refuses each one. That failed load is also what breaks the mutation check, which is why the two rows always appear together. StorageSystemMutations::fillData iterates every database (StorageSystemMutations.cpp:81,89) at the default skip_not_loaded = false, so DatabaseOrdinary::getTablesIterator waitLoads all startup_table jobs (DatabaseOrdinary.cpp:722-738) and waitLoad rethrows (AsyncLoader.cpp:476-477). Every `SELECT ... FROM system.mutations` on that server throws ASYNC_LOAD_WAIT_FAILED; the runner's probe is a command substitution with `||:` (upgrade_runner.sh:457-461), so the throw yields an empty string, never equal to 1, and after 60 attempts the second row is written. Skipping the test in the pre-upgrade phase leaves nothing incompatible behind, so both rows go away and the `<Error>` scan keeps full sensitivity. An allow-list entry was the first draft and is the wrong layer: it can only ever clear the first row, and the second must not be allow-listed, as this file says at :492-495 ("a mutation error here is a real finding. Do not allow-list a new one"). It is also the doctrine the mutation-kill comment at :170-190 already argues for, removing causes rather than growing the list. The previous release is whatever get_previous_release_tag.py returns at run time, so a skip on a static test name would outlive its reason. Master's copy of the same test name already builds that data file out of empty arrays (faf29df), so an unconditional skip would, at the first release advance past the aggregate state version, silently stop running a by-then valid test with nothing reporting that it had expired. The skip is therefore keyed on the cloned copy's own text and expires by itself. `countResample` is the discriminator rather than the exact parameterisation, since it covers both empty spellings the test has used and master's copy contains no `Resample` at all; the release version is deliberately not the key, because that would hard-code 26.9 and break on a patch release. If the predicate ever stops matching while an incompatible fixture is still there, the red comes back loudly on the next run, which is the correct failure direction. The option has to travel in a bash array. Quoting the value preserves its embedded space, so the array expands to exactly one argv token when the predicate matches and to zero when it does not; an unquoted scalar would split on that space and hand stress.py a stray positional, and a quoted scalar would pass an empty token in the no-skip branch. Neither the `[ -f ]` guard nor a non-matching grep trips `set -e` inside an `if` condition, and a release predating the test is a silent no-skip rather than a `grep: No such file` line under `set -x`. Verified: the two-symptom chain reproduces deterministically by letting v26.9.1.1629 create t1 (Log) and t6 (TinyLog) and restarting a master binary on the same path, and a run without those tables produces no `<Error>` line and a probe result of 1. Driving this block with a stress shim that prints its argv, the v26.9 clone yields exactly one `--skip-func-tests` token while master's own copy of the test and a missing file each yield zero extra tokens and no empty one; stress.py's own parser then reads skip_func_tests as the intended value and as the empty string respectively. Over 1280 composed command shapes per branch (8 worker indices x the encrypted-storage coin flip x 40 random get_options draws, real and smoke) clickhouse-test's own parser reads args.skip as exactly ['05211_backup_log_zero_byte_data_file'] and as None, with the smoke check's positional test names intact throughout. Of the 15459 test names in the cloned v26.9 suite the skip predicate (clickhouse-test:3216) matches exactly one, and all eight other 05211_* tests still run. Of the eight persisted type spellings in that suite naming a `-Resample` combinator or a variance matrix, only 05211's is refused by master, so one skip is enough. shellcheck reports the same four pre-existing diagnostics before and after. Co-Authored-By: Claude Opus 5 <[email protected]>
Internal second-model review (click to expand)Two independent passes per round over this change: my own cold read of the resulting script, then a Round 1 (head
What the passes confirmed rather than flagged. The attribution: the failing DDL is byte-for-byte |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-5:20260922-013100, cron:clickhouse-impl-slot-6:20260922-022900 |
|
Workflow [PR], commit [3c02bda] Summary: ✅ AI ReviewSummaryThis PR makes Final VerdictStatus: ✅ Approve |
azat
left a comment
There was a problem hiding this comment.
This is very ugly solution, before we had no-stress tag but it was removed, I will do a different thing
|
Understood, I will not push a rewrite here. The one thing I would rather not decide myself: should this stay open as a stopgap until your replacement lands, or do you want it closed now? Asking because the failure is still spreading: the signature has hit 11 distinct PRs in the last 15 hours, 5 of them other authors', the most recent at 14:18 UTC today. #121506 adds the same kind of skip for |
|
This is the correct fix - #121590 |
Related: #119728
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Stop the upgrade check from creating, in its previous-release phase, a table whose column type the upgraded server is documented to refuse.
Description
Upgrade check (amd_release)writes two FAIL rows from one cause, e.g. this run:Error message in clickhouse-server.logandThe mutation submitted before the upgrade was not finished by the new server.The pre-upgrade phase runs the previous release's copy of the suite (
upgrade_runner.sh:44clones the tag,:148pointsclickhouse-testat it). Atv26.9.1.1629-stable,05211_backup_log_zero_byte_data_file.sh:18types five Log family tablesAggregateFunction(countResample(10, 5, 1), UInt64, UInt64)and restores a copy of each. #119728 rejects that parameterisation, and shipped as a Backward Incompatible Change saying so: "a table with such a column no longer loads."--upgrade-checkimplies--fake-drop, so the old server's tables survive the restart and the new binary correctly refuses each one, logging<Error> AsyncLoader::worker: Code: 69.That failed load is also what breaks the mutation check, which is why the two rows co-occur:
StorageSystemMutations::fillDataiterates every database at the defaultskip_not_loaded = false, soDatabaseOrdinary::getTablesIteratorwaitLoads all startup jobs andwaitLoadrethrows. EverySELECT ... FROM system.mutationsthen throwsASYNC_LOAD_WAIT_FAILED; the runner's probe is a command substitution with||:, so it yields'', never1.So I skip the test in that phase rather than allow-list the log line. Removing the cause clears both rows and keeps the
<Error>scan fully sensitive; an allow-list entry could only clear the first, and this file forbids allow-listing the second (:492-495, "a mutation error here is a real finding"). Master's own copy uses empty arrays instead, so the skip is keyed on the cloned test's own text (grep -q countResample) and stops applying by itself when that fixture goes away. #119728 is master-only (26.9/26.8/26.7alldiverged); if it is backported, this needs revisiting.The mutation row can still fail from other attach failures, which #121315 and #120932 own; this change removes only my cause.
Validation (click to expand)
Reproduced deterministically:
v26.9.1.1629createst1(Log) andt6(TinyLog), a master binary restarts on the same path, and I get one<Error> ... Cannot attach tableper table plus a probe result of''. The same script without those tables gives zero<Error>lines and a probe result of1.-Resamplecombinator or a variance matrix, only 05211's is refused by master, so one skip suffices. NoCREATE TABLE ... AS SELECTpersists such a state either.clickhouse-test:3216, substring) matches exactly 1; the other eight05211_*tests still run.get_optionsdraws x real and smoke),clickhouse-test's own parser readsargs.skipas exactly['05211_backup_log_zero_byte_data_file'], and the smoke check's positional test names survive--skip'snargs="+".clickhouse-testover the cloned suite differs in exactly one line:05211_backup_log_zero_byte_data_file: [ FAIL ] -> [ SKIPPED ].shellcheckreports the same four pre-existing diagnostics before and after.check_style.py: 15/16 legs pass, the 16th needing CI-sidechanged_filesdata.Workflow [PR]
Sync PR [sync-upstream/pr/121484]