Repository navigation
Fix flaky test test_storage_s3_queue/test_migration - #97677
Merged
Merged
Conversation
The test uses a hardcoded ZooKeeper path `/clickhouse/databases/replicateddb3` for its `Replicated` database. On retries, after `restart_with_original_version` switches nodes back to 24.5 binary, `DROP DATABASE IF EXISTS r` may not fully clean the ZK path — leaving it in a partial state where the parent node exists but `max_log_ptr` is missing. The subsequent `CREATE DATABASE` then fails with `KEEPER_EXCEPTION`. Fix: explicitly clean the ZK path via kazoo after dropping the database, and also drop the database (not just the table) at the end of the test. https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=97671&sha=b978c6092f4758c5cd3b1864248542ef3532c4d0&name_0=PR&name_1=Integration%20tests%20%28amd_asan%2C%20db%20disk%2C%20old%20analyzer%2C%206%2F6%29 Co-Authored-By: Claude Opus 4.6 <[email protected]>
Contributor
kssenii
reviewed
Feb 23, 2026
Comment on lines
+108
to
+111
| # Clean up the ZK path in case DROP DATABASE on an older binary didn't fully remove it | ||
| zk_client = started_cluster.get_kazoo_client("zoo1") | ||
| if zk_client.exists("/clickhouse/databases/replicateddb3"): | ||
| zk_client.delete("/clickhouse/databases/replicateddb3", recursive=True) |
Member
There was a problem hiding this comment.
Likely this could be fixed by adding a flag clear_data_dir=True in node.restart_with_original_version() above.
1 task
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.
Summary
test_storage_s3_queue/test_migrationby explicitly cleaning the ZooKeeper path/clickhouse/databases/replicateddb3afterDROP DATABASE, in case the older (24.5) binary didn't fully remove itrat the end of each test (not just the table) so the next run starts cleanThe test uses a hardcoded ZK path for its
Replicateddatabase. On retries, afterrestart_with_original_versionswitches nodes back to 24.5,DROP DATABASE IF EXISTS rmay leave the ZK path in a partial state (parent exists butmax_log_ptris missing), causingCREATE DATABASEto fail withKEEPER_EXCEPTION.https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=97671&sha=b978c6092f4758c5cd3b1864248542ef3532c4d0&name_0=PR&name_1=Integration%20tests%20%28amd_asan%2C%20db%20disk%2C%20old%20analyzer%2C%206%2F6%29
#97671
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
🤖 Generated with Claude Code