Fix #1711 - DDLWorker: don't recreate replica dirs on every main-loop tick#1712
Open
CarlosFelipeOR wants to merge 2 commits intoantalya-25.8from
Open
Fix #1711 - DDLWorker: don't recreate replica dirs on every main-loop tick#1712CarlosFelipeOR wants to merge 2 commits intoantalya-25.8from
CarlosFelipeOR wants to merge 2 commits intoantalya-25.8from
Conversation
After upstream PR ClickHouse#92339, DDLWorker::markReplicasActive() unconditionally re-creates /clickhouse/task_queue/replicas/<host_id> on every iteration of runMainThread, racing with external recursive cleanup of /clickhouse and deterministically breaking test_replication_without_zookeeper::test_startup_without_zookeeper on antalya-25.8 since 25.8.21 (PR #1600). Add a `should_create_dirs` parameter to markReplicasActive and only call createReplicaDirs from real events (initialization/reconnect, or when a new host ID was just observed via host_ids_updated), not on every tick. This restores the pre-ClickHouse#92339 invariant ("create host dirs once at startup/reconnect") while preserving the interserver-IO fix. Generated with assistance from AI model Claude Opus 4.7. See #1711. Made-with: Cursor
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.
Fix #1711
Test PR. The fix was authored with assistance from AI model Claude Opus 4.7.
After upstream PR ClickHouse#92339,
DDLWorker::markReplicasActive()unconditionally re-creates/clickhouse/task_queue/replicas/<host_id>on every iteration ofrunMainThread, racing with external recursive cleanup of/clickhouseand deterministically breakingtest_replication_without_zookeeper::test_startup_without_zookeeperonantalya-25.8since 25.8.21 (PR #1600).This change adds a
should_create_dirsparameter tomarkReplicasActiveand only callscreateReplicaDirsfrom real events (initialization/reconnect, or when a new host ID was just observed viahost_ids_updated), not on every tick. This restores the pre-ClickHouse#92339 invariant ("create host dirs once at startup/reconnect") while preserving the interserver-IO fix from ClickHouse#92339.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Fix race in
DDLWorkerthat broke recursive deletion of the DDL queue path in ZooKeeper.Documentation entry for user-facing changes
...
CI/CD Options
Exclude tests:
Regression jobs to run:
Made with Cursor