Repository navigation
Fix flaky test test_refreshable_mv in DROP DATABASE with Replicated databases - #97138
Merged
Merged
Conversation
…d databases The sort introduced by #97057 classified `.inner_id.*` and `.inner.*` tables as inner, but missed `.tmp.inner_id.*` and `.tmp.inner.*` tables. These temporary tables are created by refreshable materialized views during the table-swap phase of a refresh. `dropInnerTableIfAny` drops both the main inner table and the temporary one. Without classifying the temporary tables as inner, the sort could place the MV before its temp inner table, causing `dropInnerTableIfAny` to attempt dropping the temp table via a new `InterpreterDropQuery` that goes through the replicated DDL path and fails with "It's not initial query. ON CLUSTER is not allowed for Replicated database." CI report: https://play.clickhouse.com/play?user=play&run=1#U0VMRUNUIGNoZWNrX3N0YXJ0X3RpbWUsIGNoZWNrX25hbWUsIHRlc3RfbmFtZSwgcmVwb3J0X3VybApGUk9NIGNoZWNrcwpXSEVSRSAxCiAgICBBTkQgY2hlY2tfc3RhcnRfdGltZSA+PSBub3coKSAtIElOVEVSVkFMIDI0IEhPVVIKICAgIEFORCAoaGVhZF9yZWYgPSAnbWFzdGVyJyBBTkQgc3RhcnRzV2l0aChoZWFkX3JlcG8sICdDbGlja0hvdXNlLycpKQogICAgQU5EIHRlc3Rfc3RhdHVzICE9ICdTS0lQUEVEJwogICAgQU5EICh0ZXN0X3N0YXR1cyBMSUtFICdGJScgT1IgdGVzdF9zdGF0dXMgTElLRSAnRSUnKQogICAgQU5EIGNoZWNrX3N0YXR1cyAhPSAnc3VjY2VzcycKICAgIEFORCBjaGVja19uYW1lIE5PVCBMSUtFICdsaWJGdXp6ZXIlJwogICAgQU5EIGNoZWNrX25hbWUgIT0gJ0NsaWNrSG91c2UgS2VlcGVyIEplcHNlbicKICAgIEFORCBjaGVja19uYW1lIE5PVCBMSUtFICdJbnRlZ3JhdGlvbiB0ZXN0cyAoYW1kX21zYW4lJwogICAgQU5EIGNoZWNrX25hbWUgTk9UIExJS0UgJ0ludGVncmF0aW9uIHRlc3RzIChhbWRfbGx2bV9jb3ZlcmFnZSUnCk9SREVSIEJZIGNoZWNrX3N0YXJ0X3RpbWUgREVTQw== Co-Authored-By: Claude Opus 4.6 <[email protected]>
Contributor
This was referenced Feb 20, 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.
Summary
PR #97057 introduced table sorting in
DROP DATABASEto drop tables in reverse dependency order. It classified.inner_id.*and.inner.*tables as "inner" (to be dropped after their parent MV), but missed.tmp.inner_id.*and.tmp.inner.*tables.These temporary tables are created by refreshable materialized views during the table-swap phase of a refresh.
StorageMaterializedView::dropInnerTableIfAnydrops both the main inner table and the temporary one. Without classifying the temporary tables as inner, the sort could place the MV before its temp inner table, causingdropInnerTableIfAnyto attempt dropping the temp table via a newInterpreterDropQuerythat goes through the replicated DDL path and fails with:The fix adds
.tmp.inner_id.*and.tmp.inner.*patterns to the inner table classification in theDROP DATABASEsort comparator.Fixes #92642
CI report: https://play.clickhouse.com/play?user=play&run=1#U0VMRUNUIGNoZWNrX3N0YXJ0X3RpbWUsIGNoZWNrX25hbWUsIHRlc3RfbmFtZSwgcmVwb3J0X3VybApGUk9NIGNoZWNrcwpXSEVSRSAxCiAgICBBTkQgY2hlY2tfc3RhcnRfdGltZSA+PSBub3coKSAtIElOVEVSVkFMIDI0IEhPVVIKICAgIEFORCAoaGVhZF9yZWYgPSAnbWFzdGVyJyBBTkQgc3RhcnRzV2l0aChoZWFkX3JlcG8sICdDbGlja0hvdXNlLycpKQogICAgQU5EIHRlc3Rfc3RhdHVzICE9ICdTS0lQUEVEJwogICAgQU5EICh0ZXN0X3N0YXR1cyBMSUtFICdGJScgT1IgdGVzdF9zdGF0dXMgTElLRSAnRSUnKQogICAgQU5EIGNoZWNrX3N0YXR1cyAhPSAnc3VjY2VzcycKICAgIEFORCBjaGVja19uYW1lIE5PVCBMSUtFICdsaWJGdXp6ZXIlJwogICAgQU5EIGNoZWNrX25hbWUgIT0gJ0NsaWNrSG91c2UgS2VlcGVyIEplcHNlbicKICAgIEFORCBjaGVja19uYW1lIE5PVCBMSUtFICdJbnRlZ3JhdGlvbiB0ZXN0cyAoYW1kX21zYW4lJwogICAgQU5EIGNoZWNrX25hbWUgTk9UIExJS0UgJ0ludGVncmF0aW9uIHRlc3RzIChhbWRfbGx2bV9jb3ZlcmFnZSUnCk9SREVSIEJZIGNoZWNrX3N0YXJ0X3RpbWUgREVTQw==
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.6 [email protected]
Version info
26.2.1.825