Fix table drop getting permanently stuck with zero-copy replication#96965
Merged
alexey-milovidov merged 2 commits intomasterfrom Feb 16, 2026
Merged
Fix table drop getting permanently stuck with zero-copy replication#96965alexey-milovidov merged 2 commits intomasterfrom
alexey-milovidov merged 2 commits intomasterfrom
Conversation
When `dropAllData` encounters leftover part directories on disk that weren't tracked in `data_parts_by_info` (e.g., broken parts that couldn't be loaded), it threw `ZERO_COPY_REPLICATION_ERROR` to avoid blindly calling `removeRecursive` on a zero-copy disk. However, this exception caused `DatabaseCatalog` to endlessly retry the drop every few seconds, since the leftover directory never goes away on its own. This blocked `DROP DATABASE` DDL entries from completing, causing cascading timeout failures in concurrent tests. Replace the throw with `removeSharedRecursive` using `keep_all_shared_data=true`, which safely removes local metadata while preserving shared objects (e.g., S3 data) that other replicas may still reference. This follows the same pattern already used for cleaning up the `detached/` directory and temporary directories in the same function. Closes #82676 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
|
Workflow [PR], commit [662ff3b] Summary: ❌
|
Merged
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
dropAllDatapermanently blockingDROP DATABASEDDL when leftover part directories exist on disk with zero-copy replication enabledZERO_COPY_REPLICATION_ERRORexception (which caused infinite retry inDatabaseCatalog) withremoveSharedRecursiveusingkeep_all_shared_data=trueto safely clean up local metadata while preserving shared S3 objectsdetached/directory cleanup and temporary directory cleanup in the same functionThe issue occurs when a part directory exists on disk but isn't tracked in
data_parts_by_info(e.g., a broken part with corrupteddata.binthat couldn't be loaded). The thrown exception propagates toDatabaseCatalog::dropTablesParallel, which retries forever since the condition never resolves, blocking subsequent DDL operations and causing cascading test failures.Closes #82676
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
🤖 Generated with Claude Code