Skip to content

Fix flaky test test_storage_s3_queue/test_migration - #97677

Merged
alexey-milovidov merged 1 commit into
masterfrom
fix-flaky-test-s3queue-migration
Feb 23, 2026
Merged

alexey-milovidov merged 1 commit into
masterfrom
fix-flaky-test-s3queue-migration

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Feb 23, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Fix flaky test_storage_s3_queue/test_migration by explicitly cleaning the ZooKeeper path /clickhouse/databases/replicateddb3 after DROP DATABASE, in case the older (24.5) binary didn't fully remove it
  • Drop database r at the end of each test (not just the table) so the next run starts clean

The test uses a hardcoded ZK path for its Replicated database. On retries, after restart_with_original_version switches nodes back to 24.5, DROP DATABASE IF EXISTS r may leave the ZK path in a partial state (parent exists but max_log_ptr is missing), causing CREATE DATABASE to fail with KEEPER_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):

  • CI Fix or Improvement (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

...

🤖 Generated with Claude Code

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]>
@clickhouse-gh

clickhouse-gh Bot commented Feb 23, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [c9408ca]

Summary: ✅

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Feb 23, 2026
@alexey-milovidov alexey-milovidov self-assigned this Feb 23, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue 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)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likely this could be fixed by adding a flag clear_data_dir=True in node.restart_with_original_version() above.

Merged via the queue into master with commit c546406 Feb 23, 2026
144 checks passed
@alexey-milovidov
alexey-milovidov deleted the fix-flaky-test-s3queue-migration branch February 23, 2026 11:54
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

3 participants