Fix flaky test 01079_parallel_alter_detach_table_zookeeper#96888
Merged
alexey-milovidov merged 3 commits intomasterfrom Feb 14, 2026
Merged
Fix flaky test 01079_parallel_alter_detach_table_zookeeper#96888alexey-milovidov merged 3 commits intomasterfrom
01079_parallel_alter_detach_table_zookeeper#96888alexey-milovidov merged 3 commits intomasterfrom
Conversation
`SYSTEM SYNC REPLICA` may return while a `MUTATE_PART` entry is still postponed in the replication queue (e.g. waiting for an in-progress `MERGE_PARTS` on the same part to complete). The test then immediately checks `system.replication_queue` and finds the not-yet-processed entry, causing a spurious diff against the reference file. Add a retry loop that waits for both pending mutations and replication queue entries (`ALTER_METADATA`/`MUTATE_PART`) to drain before asserting. Also add `database` filtering to the `system.replication_queue` query for proper test isolation. https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=96874&sha=7d053394dc3bdd556f989a8546389fdab344aa41&name_0=PR&name_1=Stateless%20tests%20%28amd_debug%2C%20AsyncInsert%2C%20s3%20storage%2C%20sequential%29 Closes #91413 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
| $CLICKHOUSE_CLIENT --receive_timeout 120 --query "SYSTEM SYNC REPLICA concurrent_alter_detach_$i" | ||
| $CLICKHOUSE_CLIENT --query "SELECT SUM(toUInt64(value1)) > $INITIAL_SUM FROM concurrent_alter_detach_$i" | ||
|
|
||
| # Wait for all mutations and replication queue entries to finish. |
Member
Author
There was a problem hiding this comment.
Not sure about the exact reasoning. At least I'd expect that when the entry is in the queue, a subsequent SYNC REPLICA has to wait for it.
Member
Author
There was a problem hiding this comment.
I'll edit the comment.
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
SYSTEM SYNC REPLICAthat waits for pending mutations and replication queue entries (ALTER_METADATA/MUTATE_PART) to drain before asserting they're emptySYSTEM SYNC REPLICAmay return while aMUTATE_PARTentry is still postponed (e.g. waiting for an in-progressMERGE_PARTSon the same part to complete), causing a spurious diffdatabasefiltering to thesystem.replication_queuequery for proper test isolationCI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=96874&sha=7d053394dc3bdd556f989a8546389fdab344aa41&name_0=PR&name_1=Stateless%20tests%20%28amd_debug%2C%20AsyncInsert%2C%20s3%20storage%2C%20sequential%29
Closes #91413
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Documentation entry for user-facing changes
🤖 Generated with Claude Code