Repository navigation
Make the taken-active-node test claim the replica one host at a time - #121820
Algunenano merged 1 commit into
Conversation
CREATE DATABASE ... ON CLUSTER made both hosts claim the same replica record at once. The host that lost that claim failed the CREATE itself with REPLICA_ALREADY_EXISTS, which the initiator returned to the client, so the test raised at the CREATE before it could observe the error it is about: the contended <replica_path>/active node reported asynchronously by the losing replica. Measured 6 failures in 420 post-merge runs (1.4%) across 6 unrelated PRs and 4 check flavours. Create the database on node1, wait until it holds the active node, then have node2 claim the same identity with node1's database UUID, which is the statement ON CLUSTER sends to each host. Only the active node is contended now, so the loser is determinate: assert on node2 and assert that node1 never reports it. The cluster config has no reader left and is removed. Co-Authored-By: Claude Opus 5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 0 findings; bounded: 1 full pass +
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-11:20260923-172700 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-5:20260923-161100 |
|
Workflow [PR], commit [a2ff290] Summary: ❌
|
CI finish ledger - a2ff290Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task whose
Measured at this head, not inherited: all 349 check runs are complete, Neither row can come from this diff, which changes one integration test plus its config Session id: cron:our-pr-ci-monitor:20260924-020454 |
63751de
Picks up ClickHouse#121820, which fixed the REPLICA_ALREADY_EXISTS race in test_active_node_owned_by_another_server that was the only diff-unrelated red. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Not required (test-only change).
Description
test_active_node_owned_by_another_server, which I added in #114408 (merged 2026-09-23 00:55Z),is flaky at ~2.2% on master: 13 failures in 599 runs since that merge, across 12 unrelated PRs, one
master run and 8 check flavours. Failing jobs:
Integration tests (amd_tsan, 2/6):https://github.com/ClickHouse/ClickHouse/actions/runs/35808507331/job/107181413733
Integration tests (arm_binary, distributed plan, 4/4):https://github.com/ClickHouse/ClickHouse/actions/runs/35808835971/job/107201700502
The test used
CREATE DATABASE ... ON CLUSTER, so both hosts claimed the same replica record atonce. A host that finds the record present with the same database UUID takes it over and the CREATE
succeeds; a host that reads it as absent re-reads it while creating, finds the other host's id and
fails with
REPLICA_ALREADY_EXISTS, which the initiator returns to the client. The test toleratedonly the first ordering, so it raised at the CREATE before reaching what it is actually about: the
contended active node, reported asynchronously by the losing replica.
Now node1 creates the database, the test waits until node1 holds the active node, and node2 claims
the same identity carrying node1's database UUID, which is the statement
ON CLUSTERsends to eachhost. Only the active node is contended, so the loser is determinate: the assertions move to node2,
and a new one pins that node1 never reports the error. The cluster config has no reader left and is
removed.
Measured: the pre-fix test fails 3 of 20 fresh local runs (15%), the loser symmetric across that
sample; the new test passes 50 of 50. As a negative control, turning the underlying error back into
a logical error makes the new test fail again, so it still catches the regression #114408 fixed.
Both orderings report the misconfiguration correctly; the wedged database it leaves behind stays
#115818's subject.
Workflow [PR]
Sync PR [sync-upstream/pr/121820]
Version info
26.10.1.597-master(included in26.10and later)