Open
Conversation
filimonov
reviewed
Mar 4, 2026
| WHERE active | ||
| ) b | ||
| ON a.database = b.database AND a.table = b.table AND a.partition_id = b.partition_id | ||
| WHERE a.min_block_number IS NOT NULL |
Member
There was a problem hiding this comment.
Do we really want to suggest removing all?
| Here is a quick way to find out if you have detached parts along with the reason why. | ||
| ### Monitoring of detached parts | ||
|
|
||
| You can find information in `clickhouse-server.log`, for what happened when the parts were detached during startup. If `clickhouse-server.log` is lost it might be impossible to figure out what happened and why the parts were detached. |
Member
There was a problem hiding this comment.
part_log fragment disappeared.
filimonov
reviewed
Mar 4, 2026
| Here is a query that can help with investigations. It looks for active parts containing the same data blocks as the detached parts and generates commands to drop the detached parts. | ||
|
|
||
| ```sql | ||
| SELECT a.*, |
Member
There was a problem hiding this comment.
since we generating set of ALTER statements there, i would put all missing details to the comment of ALTER, to simplify copy and paste.
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.
Updated detached-parts KB with safer cleanup guidance and query fixes: added warnings before destructive actions, added asynchronous detached-part monitoring queries, fixed the bulk DROP DETACHED helper to use system.detached_parts block columns (validated locally), and shortened appendix/reference links for readability.
I have read the CLA Document and I hereby sign the CLA