Repository navigation
Stop randomizing the Keeper feature flags that transactions require in the stress and upgrade checks - #120932
Conversation
…n the stress and upgrade checks
Upgrade check (amd_release) has been failing since 2026-09-18 12:03 UTC with
Code: 344. DB::Exception: Transactions require Keeper to advertise
`LIST_WITH_STAT_AND_DATA`, `FILTERED_LIST`, `MULTI_READ` and `CHECK_STAT`
feature flags. Upgrade the Keeper cluster: Cannot attach table ...
(SUPPORT_IS_DISABLED)
logged from AsyncLoader::worker, with that table's load job finishing FAILED and
later queries on it getting Code: 722. It is 12 of 229 upgrade-check runs (5.2%)
across 12 unrelated PRs.
The configuration these checks build is internally inconsistent.
tests/config/install.sh always links config.d/transactions.xml, so every stress
and upgrade server runs with allow_experimental_transactions=42; configure() in
stress_tests.lib then rolls filtered_list and multi_read 50/50 into the embedded
Keeper's config.d/keeper_port.xml. KeeperContext force-enables FILTERED_LIST only
when multi_read is on, so with p = 1/2 per server start the Keeper advertises
neither. upgrade_runner.sh calls configure() once per release, so the two servers
roll independently and the pre-upgrade server can be stopped mid-run leaving
parts whose txn_version.txt carries a transactional creation_tid. Loading such a
part on the restarted server runs MergeTreeData::loadDataPart ->
VersionMetadata::loadAndUpdateMetadata -> validateInfo, which calls
TransactionManager::instance() for any creation_tid that is not
isNonTransactional() and so constructs the lazy singleton; its constructor
requires the four flags and fails closed, aborting the ATTACH. The requirement
reached master only with ClickHouse#117822 (merge 0386af7, 2026-09-18 02:03 UTC),
which is why the failures start that day.
Requiring the flags is deliberate, and ClickHouse#117822 already applied the matching
remedy on the integration side by pinning keeper_required_feature_flags in the
transaction tests. The shell harness shared by Stress test (*) and Upgrade
check (*) is the one it missed, so stop randomizing those two flags there.
check_not_exists, create_if_not_exists and remove_recursive keep rolling, and the
MULTI_READ-off client path keeps dedicated coverage in
tests/integration/test_refreshable_mv_no_multi_read.
Verified with two single-node servers over one data directory differing only in
the two flags: off, both a committed and an uncommitted transactional part fail
to attach with the same stack frames as the CI artifact; on, both load. Driving
the real configure() block over 50 seeds x 40 iterations keeps both flags enabled
in 2000/2000 rolls, against 985/2000 disabled once the two deleted lines are
restored.
Internal second-model review: adjudication log (click to expand)Pre-publication review of this branch by an independent model (engine: codex, 0 findings), plus my
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-9:20260918-225100 |
|
Workflow [PR], commit [c57699f] Summary: ✅ AI ReviewSummaryThis PR removes Missing context / blind spots
Final Verdict✅ No blocking or major issues found in the current patch. |
|
@groeneai the link of Failing report is broken. |
|
Thanks, fixed. The body now links that report's own error artifact, which needs no JS loader: The URL is taken verbatim from the job report's I could not reproduce the loader failure from my side: every object |
e0b84a6
…finished mutation The mutation-across-upgrade probe asks system.mutations whether the mutation submitted to the old server was finished by the new one. That query cannot be narrowed to the table it is about: StorageSystemMutations::fillData resolves every table it enumerates (StorageSystemMutations.cpp:91) before the *MergeTree narrowing at :95 and the predicate at :128, and getTablesIterator waits on each table's startup job and rethrows its exception (DatabaseOrdinary.cpp:722-741). One unrelated table that cannot load therefore makes the probe throw whatever the WHERE says. `var=$(clickhouse-client ...) ||:` then erased the throw: stderr went to the job log, the exit status was discarded, and the variable was left as the empty string. Only `= 1` was tested, so empty fell into the else branch and the job reported that this mutation had not finished. The diagnostic dump reads system.mutations too, so it threw for the same reason and the artifact the message pointed at was 0 bytes. Over 14 days of CIDB this produced 9 such rows on 9 unrelated pull requests against 225 passes, with an empty failure context every time. On ClickHouse#121247 the mutation was applied at 07:59:40.104 while all 60 probe executions ran between 08:00:35 and 08:01:39 and every one of them threw, so the report named the wrong subsystem and carried no evidence for it. The underlying load failure in those runs was the Keeper feature-flag error already fixed by ClickHouse#120932; this change is the attribution half. Give the probe three outcomes instead of two, which is the idiom this file already uses for its two other system.mutations probes at :203 and :220: keep the answer-1 and answer-0 rows exactly as they were, and report a thrown probe as its own row carrying the real error text. That row stays a FAIL, because the check could not be performed and passing silently would lose the same signal in the other direction. The assertion is neither relaxed nor narrowed and a genuinely unfinished mutation still reds byte-identically. The `||` guard is load-bearing rather than decoration: `set -ex` is in effect, and `A || B` with an assignment for B always succeeds. The existing if/then/break/fi is kept for the same reason, since a false `&&` list as the last command of the loop body would exit the job. The probe's stderr is captured so the new row can carry its cause, and removed when empty per the convention already at :239 and :439. The dump gains 2>&1 so it can no longer be the empty artifact a message points at. Requested at ClickHouse#120908 (comment) Co-Authored-By: Claude Opus 5 <[email protected]>
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Not required: CI-only change to the stress and upgrade checks' Keeper config.
Description
Related: #117822. Failing report on PR #118422.
Upgrade check (amd_release)started failing today with12 of 229 upgrade-check runs (5.2%) across 12 unrelated PRs, since #117822 merged at 02:03 UTC. The table fails to ATTACH, so later queries on it get
Code: 722.The cause is a contradiction in the CI configuration, not a server defect.
tests/config/install.shalways installstransactions.xml(allow_experimental_transactions=42), whileconfigure()instress_tests.librollsfiltered_listandmulti_read50/50 into the embedded Keeper's config. Whenmulti_readrolls 0 and a part carrying a transactionalcreation_tidis loaded,MergeTreeData::loadDataPart->VersionMetadata::validateInfoconstructs the lazyTransactionManager, whose constructor fails closed.This stops randomizing those two flags and keeps the other three. That is the remedy #117822 used on the integration side, pinning the four flags via
keeper_required_feature_flagsin its transaction tests; 13 integration modules pin flags this way. The flags-off client paths keep coverage in the integration suite, wherehelpers/cluster.pyrandomizes every unpinned flag, plustest_refreshable_mv_no_multi_read.tests/casa_del_dolorcan build the same combination but is not in CI.Validated with two single-node servers over one data directory differing only in those flags. Flags off, a committed and an uncommitted transactional part both fail to attach with
Code: 344and the artifact's frames; flags on, both load. Driving the realconfigure()block 2000 times pins both flags every roll, against 985/2000 disabled with the two lines restored.@tuanpach, would you rather the transaction log fall back to flag-free reads, as
DatabaseReplicated::getSnapshotdoes? There is none today: the client rejects with-stat/with-data list and multi-read outright, so a Keeper predatingLIST_WITH_STAT_AND_DATA(26.2) cannot run transactions at all. This PR is only the CI fix and does not settle that.Workflow [PR]
Sync PR [sync-upstream/pr/120932]
Version info
26.10.1.319-master(included in26.10and later)