-
Notifications
You must be signed in to change notification settings - Fork 47
Closed
Description
Detached Parts KB Accuracy + Extension Plan (Target: ClickHouse 23.10+)
Summary
Update content/en/altinity-kb-useful-queries/detached-parts.md to be correct for modern ClickHouse (23.10+), remove risky cleanup guidance, add version-scoped behavior notes from changelog/source, and add production-safe recipes informed by relevant GitHub issues.
Findings To Fix First (ordered by severity)
-
P1: Unsafe deletion guidance encourages filesystem deletion directly
- Current text suggests broad deletion and generates
sudo rm -rcommands. - Risk: bypasses ClickHouse metadata/replication/object-storage safety.
- Fix: SQL-first cleanup (
ALTER ... DROP DETACHED ... SETTINGS allow_drop_detached=1), filesystem deletion only as emergency manual procedure.
- Current text suggests broad deletion and generates
-
P1: Auto-cleanup statement needs version scope
- Behavior changed across versions.
- 22.6 introduced timeout-based cleanup for selected detached reasons.
- 23.10 removed automatic broken-part removal option.
- Fix: explicit version matrix and 23.10+ default behavior.
-
P1: Existing drop script is brittle due to manual part-name parsing
- Current script parses names via split-by-underscore.
- Edge cases (
*_tryN, invalid detached names) can break logic. - Fix: rely on
system.detached_partscolumns (reason,partition_id,min_block_number,max_block_number) and explicit invalid-name detector query.
-
P2: Reason taxonomy is duplicated and misses
NULL/empty semanticsreasoninsystem.detached_partsis nullable.- Empty string and
NULLhave different operational meaning. - Fix: single canonical reason/action table with explicit handling.
-
P2:
DROP DETACHEDsection needs concrete actionable examples- Add
PART,PARTITION ID, andALLexamples withallow_drop_detached=1.
- Add
-
P3: Source references pinned to old commit hash
- Fix: use maintained source/changelog links and add issue/PR references for rare behaviors.
Implementation Plan
- Restructure article sections while preserving page slug/title.
- Add version scope section (23.10+ primary, 22.6-23.9 compatibility note).
- Consolidate detached reasons into one reason/action matrix.
- Replace risky guidance with SQL-first cleanup workflow.
- Add recipe set:
- inventory by reason/size/age,
- invalid-name detector,
- replica health gate,
- safe-drop generator for covered
ignored|clone, - user-detached attach generator,
- stale temporary prefix triage,
- downgrade edge-case helper for
broken-on-start_rename.
- Add references section with docs/changelog/source/issues.
Public Interface Changes
- File changed:
content/en/altinity-kb-useful-queries/detached-parts.md - No product/runtime code changes.
- Documentation behavior: clearer safety boundaries and version-accurate guidance.
Acceptance Criteria
- Article states 23.10+ manual cleanup behavior explicitly.
- Legacy 22.6-23.9 auto-cleanup behavior is documented as compatibility note.
- No default recommendation uses
rm -rfor routine cleanup. reasonnullable semantics (''vsNULL) are documented.- Recipes are copy-paste SQL and operationally safe for replicated/object-storage deployments.
- References include upstream docs/changelog and relevant issues/PRs.
Source Evidence To Cite
- Changelog 2022: detached timeout cleanup introduced (PR #37975).
- Changelog 2023 (23.10): automatic broken detached parts removal option removed (PR #55184).
- Docs: ALTER PARTITION / DROP DETACHED syntax.
- Docs:
system.detached_partssemantics. - Source: detached reasons list in
MergeTreePartInfo.h. - Rare/edge references: #55309, #55645, #53877, #54506, #40031, #37466, #58509, #68408, #85351.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels