Skip to content

Commit 3614732

Browse files
authored
Merge pull request #126 from Altinity/sphoorti
Minor updates to detached parts article
2 parents 42a568b + e4c8a0d commit 3614732

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

Diff for: content/en/altinity-kb-setup-and-maintenance/recovery-after-complete-data-loss.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
2-
title: "recovery-after-complete-data-loss"
3-
linkTitle: "recovery-after-complete-data-loss"
2+
title: "Recovery after complete data loss"
3+
linkTitle: "Recovery after complete data loss"
44
weight: 100
55
description: >-
6-
Recovery after complete data loss
6+
When disaster strikes
77
---
88

9-
# Atomic & Ordinary databases.
9+
## Atomic & Ordinary databases.
1010

1111
srv1 -- good replica
1212

Diff for: content/en/altinity-kb-useful-queries/detached-parts.md

+12-8
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
---
2-
title: "Can detached parts be dropped?"
2+
title: "Can detached parts in ClickHouse® be dropped?"
33
linkTitle: "Can detached parts be dropped?"
44
description: >
5-
Can detached parts be dropped?
5+
Cleaning up detached parts without data loss
6+
keywords:
7+
- clickhouse detached parts
8+
- clickhouse detach
9+
- clickhouse drop partition
610
---
7-
Here is what different statuses mean:
11+
ClickHouse® users should monitor for detached parts and act quickly when they appear. Here is what the different statuses of detached parts mean:
812

9-
1. Parts are renamed to 'ignored' if they were found during ATTACH together with other, bigger parts that cover the same blocks of data, i.e. they were already merged into something else.
10-
2. Parts are renamed to 'broken' if ClickHouse® was not able to load data from the parts. There could be different reasons: some files are lost, checksums are not correct, etc.
11-
3. Parts are renamed to 'unexpected' if they are present locally, but are not found in ZooKeeper, in case when an insert was not completed properly. The part is detached only if it's old enough (5 minutes), otherwise CH registers this part in ZooKeeper as a new part.
12-
4. Parts are renamed to 'cloned' if ClickHouse have had some parts on local disk while repairing lost replica so already existed parts being renamed and put in detached directory. Controlled by setting `detach_old_local_parts_when_cloning_replica`.
13+
1. Parts are renamed to **ignored** if they were found during ATTACH together with other, bigger parts that cover the same blocks of data, i.e. they were already merged into something else.
14+
2. Parts are renamed to **broken** if ClickHouse was not able to load data from the parts. There could be different reasons: some files are lost, checksums are not correct, etc.
15+
3. Parts are renamed to **unexpected** if they are present locally, but are not found in ZooKeeper, in case when an insert was not completed properly. The part is detached only if it's old enough (5 minutes), otherwise CH registers this part in ZooKeeper as a new part.
16+
4. Parts are renamed to **cloned** if ClickHouse has had some parts on local disk while repairing lost replica so already existed parts being renamed and put in detached directory. Controlled by setting `detach_old_local_parts_when_cloning_replica`.
1317

1418
'Ignored' parts are safe to delete. 'Unexpected' and 'broken' should be investigated, but it might not be an easy thing to do, especially for older parts. If the `system.part_log table` is enabled you can find some information there. Otherwise you will need to look in `clickhouse-server.log` for what happened when the parts were detached.
1519
If there is another way you could confirm that there is no data loss in the affected tables, you could simply delete all detached parts.
1620

17-
It is important to monitor for detached parts and act quickly when they appear. If `clickhouse-server.log` is lost it might be impossible to figure out what happened and why the parts were detached.
21+
Again, it is important to monitor for detached parts and act quickly when they appear. If `clickhouse-server.log` is lost it might be impossible to figure out what happened and why the parts were detached.
1822
You can use `system.asynchronous_metrics` or `system.detached_parts` for monitoring.
1923
```sql
2024
select metric from system.asynchronous_metrics where metric ilike '%detach%'

0 commit comments

Comments
 (0)