Skip to content

Stop randomizing the Keeper feature flags that transactions require in the stress and upgrade checks - #120932

Merged
alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:ci/keeper-txn-feature-flags-no-randomize
Sep 21, 2026
Merged

alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:ci/keeper-txn-feature-flags-no-randomize

Conversation

@groeneai

@groeneai groeneai commented Sep 18, 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):

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

12 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.sh always installs transactions.xml (allow_experimental_transactions=42), while configure() in stress_tests.lib rolls filtered_list and multi_read 50/50 into the embedded Keeper's config. When multi_read rolls 0 and a part carrying a transactional creation_tid is loaded, MergeTreeData::loadDataPart -> VersionMetadata::validateInfo constructs the lazy TransactionManager, 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_flags in its transaction tests; 13 integration modules pin flags this way. The flags-off client paths keep coverage in the integration suite, where helpers/cluster.py randomizes every unpinned flag, plus test_refreshable_mv_no_multi_read. tests/casa_del_dolor can 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: 344 and the artifact's frames; flags on, both load. Driving the real configure() 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::getSnapshot does? There is none today: the client rejects with-stat/with-data list and multi-read outright, so a Keeper predating LIST_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

  • Merged into: 26.10.1.319-master (included in 26.10 and later)

…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.
@groeneai groeneai added can be tested Allows running workflows for external contributors groeneai-origin-ci-master PR origin: master/nightly CI monitoring finding labels Sep 18, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author
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
own cold read of the diff, both runner callers and the config install path (3 nits, no blockers, no
majors). No source or test file changed during the review.

# Sev Finding Verdict Evidence / action
1 💡 The coverage note named only test_refreshable_mv_no_multi_read, understating what still exercises the flags-off client paths AGREE The description now names helpers/cluster.py, which randomizes every flag a test does not pin, in every integration cluster
2 💡 The question to the requirement's author read rhetorical without the one fact that makes it concrete AGREE The description now states that the client rejects with-stat/with-data list and multi-read outright, so a Keeper predating the flags cannot run transactions at all rather than running them slower
3 💡 test_database_replicated_settings and test_drop_database_replica enable transactions while pinning only multi_read and create_if_not_exists AGREE, no change They are safe for a different reason than "already pinned": transactions_enabled is data-driven (MergeTreeData.cpp:3094, :3422), so the guarded singleton is never constructed there, and CIDB has no row for this message under any integration check other than one PR's own new test

Severity: ❌ blocker / ⚠️ major / 💡 nit. DISAGREE verdicts carry recorded evidence and are terminal
per finding. Findings on hunks unchanged by a fix round are auto-dropped.

Session id: cron:clickhouse-review-slot-9:20260918-225100

@clickhouse-gh clickhouse-gh Bot added the manual approve Manual approve required to run CI label Sep 18, 2026
@clickhouse-gh clickhouse-gh Bot closed this Sep 18, 2026
@clickhouse-gh clickhouse-gh Bot reopened this Sep 18, 2026
@clickhouse-gh

clickhouse-gh Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [c57699f]

Summary: ✅


AI Review

Summary

This PR removes filtered_list / multi_read randomization from tests/docker_scripts/stress_tests.lib while keeping the other Keeper-flag fuzzing in place, which matches the current transaction invariant: tests/config/install.sh always installs transactions.xml, and TransactionManager now fails closed unless Keeper advertises LIST_WITH_STAT_AND_DATA, FILTERED_LIST, MULTI_READ, and CHECK_STAT. I did not find a remaining correctness gap in the changed path or a new inline issue to raise on the diff.

Missing context / blind spots
  • ⚠️ End-to-end proof is still pending in CI: the current Stress test (*) / Upgrade check (amd_release) jobs were not finished during this review. A passing run of those checks would close the only material validation gap.
Final Verdict

✅ No blocking or major issues found in the current patch.

@tuanpach

Copy link
Copy Markdown
Member

@groeneai the link of Failing report is broken.

@clickhouse-gh clickhouse-gh Bot added the comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). label Sep 19, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author

Thanks, fixed. The body now links that report's own error artifact, which needs no JS loader:

https://s3.amazonaws.com/clickhouse-test-reports/PRs/118422/3624837ffa8bce12fc01182560d7c22037e825d7/pr/upgrade_check_amd_release/upgrade_error_messages.txt

The URL is taken verbatim from the job report's links[], and the file is the Upgrade check (amd_release) sub-result Error message in clickhouse-server.log: Code: 344 ... Cannot attach table test_3.txn_counters.

I could not reproduce the loader failure from my side: every object praktika.html fetches for the old URL still returns 200 (commits.json, result_pr.json, result_upgrade_check_amd_release.json), and all of them were uploaded before your comment, so I replaced the link instead of guessing at it. Artifacts expire after about 14 days, which is why the error text is also quoted inline in the body.

Merged via the queue into ClickHouse:master with commit e0b84a6 Sep 21, 2026
176 of 349 checks passed
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label Sep 21, 2026
pull Bot pushed a commit to sjoerd2025/ClickHouse that referenced this pull request Sep 23, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocker This issue / pr blocks a new release can be tested Allows running workflows for external contributors comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). groeneai-origin-ci-master PR origin: master/nightly CI monitoring finding 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.

4 participants