Repository navigation
Fix flaky test_replicated_database_active_node_taken - #121866
Closed
alexey-milovidov wants to merge 1 commit into
Closed
alexey-milovidov wants to merge 1 commit into
alexey-milovidov wants to merge 1 commit into
Conversation
`CREATE DATABASE ... ON CLUSTER` creates the same replica on both hosts concurrently. If a host reads the replica node in Keeper before the other host writes it, `createReplicaNodesInZooKeeper` finds a foreign host ID and the query itself fails with `REPLICA_ALREADY_EXISTS`, before the scenario under test (the `active` node owned by another server) is reached. Create the replicas one after another with the same explicit database UUID instead, so the second host always takes over the replica written by the first and then finds its `active` node taken. CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=master&sha=66f7fa0a44e09f90f6d5c64a3e18f9d9bb5f181f&name_0=MasterCI&name_1=Integration%20tests%20%28arm_binary%2C%20distributed%20plan%2C%203%2F4%29 Related: #114408 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Contributor
|
Workflow [PR], commit [2ecfe2b] Summary: ✅ AI ReviewSummaryThis PR rewrites Missing context / blind spots
Final Verdict✅ No review findings. |
This was referenced Sep 24, 2026
Algunenano
requested changes
Sep 24, 2026
Algunenano
left a comment
Member
There was a problem hiding this comment.
I like #121820 approach a bit more (no hardcoded UUID). I'll merge that one instead
xuir268
added a commit
to xuir268/ClickHouse
that referenced
this pull request
Sep 24, 2026
Create both replicas sequentially with a shared database UUID so the test reaches the foreign active-node condition instead of failing during concurrent registration. Adapted from ClickHouse#121866. CI: https://github.com/ClickHouse/ClickHouse/actions/runs/35963033445/job/107527703365?pr=105338 PR: ClickHouse#105338 Validation: Python syntax and diff checks. Full Docker integration test requires CI.
xuir268
added a commit
to xuir268/ClickHouse
that referenced
this pull request
Sep 25, 2026
Create the active-node test replicas sequentially with one UUID. Exclude only the known-broken previous-release `quantile` fixture spelling from upgrade setup; retain corrected-test coverage and upgrade error checking. Related fixes: ClickHouse#121866 ClickHouse#121506 PR: ClickHouse#105338 CI: https://github.com/ClickHouse/ClickHouse/actions/runs/35963033445/job/107527703365?pr=105338 https://github.com/ClickHouse/ClickHouse/actions/runs/35963033445/job/107560097729?pr=105338 Performance investigation: https://github.com/ClickHouse/ClickHouse/actions/runs/35963033445/job/107560098717?pr=105338
This was referenced Oct 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
test_replicated_database_active_node_taken(added in #114408) fails often on master and in PRs, e.g. https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=master&sha=66f7fa0a44e09f90f6d5c64a3e18f9d9bb5f181f&name_0=MasterCI&name_1=Integration%20tests%20%28arm_binary%2C%20distributed%20plan%2C%203%2F4%29, with:CREATE DATABASE ... ON CLUSTERcreates the same replica on both hosts concurrently. If a host reads the replica node in Keeper before the other host writes it,createReplicaNodesInZooKeeperfinds a foreign host ID, and the query itself fails withREPLICA_ALREADY_EXISTS. The scenario under test (theactivenode owned by another live server) is never reached. The test only passed when the second host read Keeper after the first one had written the replica. In that case the matching UUID lets it take the replica over, and then it findsactivetaken.The test now creates the replicas one after another with the same explicit database UUID, which always takes that path. The unused
cluster.xmlis removed.Related: #114408
Related: #115818
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/121866]