ClickHouse recovery

A ClickHouse MergeTree table is assembled from immutable data parts whose columns, marks, indexes, and checksums must agree.

ClickHouse inserts create data parts and background merges create new parts before retiring older ones. Replicated tables coordinate part identity through Keeper, while local metadata and detached parts preserve important recovery context.

Understand the symptom

Part names encode partition and block ranges; checksums validate each file and compressed content.

WHY

What is happening

A healthy replica may supply an identical part. Older source parts may remain long enough to reconstruct a failed merge, but cleanup can remove them. Manual attachment without schema and part-range checks can duplicate data.

What you may see

Symptoms that change the recovery path.

01

Checksum does not match

One part file differs from checksums.txt.

02

Part is broken

Metadata, marks, columns, or compressed data cannot be read.

03

Merge repeatedly fails

One input part or storage path may be damaged.

04

Replica queue is stuck

Required part or mutation state is unavailable.

Protect the source

Actions that can make the situation worse.

01

Cleanup removes source parts

Freeze merges and detached-part deletion.

02

Attach can duplicate rows

Verify block ranges and replica state first.

03

Fetch can overwrite evidence

Copy local and remote parts before repair.

Do this now

Safe steps before evaluation.

01

Quiesce affected tables

Stop inserts, merges, mutations, fetches, and cleanup.

02

Snapshot all part directories

Keep metadata, checksums, marks, and filesystem attributes.

03

Capture cluster state

Save replicas, queues, Keeper paths, mutations, and system.part_log.

04

Collect backups and object versions

Preserve every alternate part source.

NEPFOSYS process

How a data-first evaluation proceeds.

01

Part inventory

NEPFOSYS maps partitions, block ranges, active/detached parts, replicas, and mutations.

02

File validation

Checksums, compressed blocks, columns, marks, and indexes are tested from copies.

03

Row-range validation

Recovered parts are compared for schema, row counts, keys, time ranges, and duplication.

A clear next step

Preserve the original device before another repair or recovery attempt.

Start a case with the exact symptoms, incident timeline, prior attempts, encryption details, and the files that matter most. NEPFOSYS will route the case to the appropriate DFW intake or nationwide mail-in path.

Start with a case review

Questions, answered

What customers ask before starting.

Can a healthy replica restore a bad part?

Often, if it has the exact part or equivalent covered range.

Can I delete the broken part?

Not before preserving it and confirming another complete source.

Why keep detached parts?

They may contain source data or prior ranges useful for reconstruction.

DFW local · Nationwide mail-in

Protect the device. Start with the facts.

Start my recovery case