Skip to content

Detached parts update#163

Open
lesandie wants to merge 5 commits intomainfrom
detached_parts_update
Open

Detached parts update#163
lesandie wants to merge 5 commits intomainfrom
detached_parts_update

Conversation

@lesandie
Copy link
Member

@lesandie lesandie commented Mar 3, 2026

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

@lesandie lesandie self-assigned this Mar 3, 2026
@lesandie lesandie requested review from SaltTan and filimonov March 3, 2026 16:05
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

part_log fragment disappeared.

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.*,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since we generating set of ALTER statements there, i would put all missing details to the comment of ALTER, to simplify copy and paste.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants