TiDB and TiKV recovery

A TiKV Region becomes unavailable when its surviving peers cannot form a leader or reproduce the required Raft history.

TiKV stores each Region as Raft peers across stores. Multiple store failures, lost Raft logs, or mismatched applied state can leave specific Regions unreadable while the rest of TiDB continues.

Understand the symptom

Unsafe recovery is intentionally lossy when the missing replicas cannot return.

WHY

What is happening

TiDB documentation states that Regions lose availability when most or all replicas go offline and describes Online Unsafe Recovery for permanently damaged stores. It may discard data from unrecoverable peers, so original stores and business priorities must be preserved first.

What you may see

Symptoms that change the recovery path.

01

Region is Unavailable errors

No leader can serve the affected Region.

02

Multiple TiKV stores failed

The Region majority may be concentrated on lost nodes.

03

Raft log entries unavailable

Commit, apply, or stored log positions do not align.

04

Only some tables or key ranges fail

Regions elsewhere still retain quorum.

Protect the source

Actions that can make the situation worse.

01

Unsafe recovery can lose data

It is designed to restore service when missing replicas are accepted as unrecoverable.

02

Tombstoning removes a peer path

A recoverable store may hold newer Region state.

03

Copying RocksDB files between stores breaks identity

Raft, Region, and store metadata must stay consistent.

Do this now

Safe steps before evaluation.

01

Stop destructive PD operations

Pause unsafe recovery, store removal, and replica cleanup.

02

Preserve all TiKV stores

Snapshot data and raft RocksDB directories with IDs intact.

03

Export Region and PD state

Save peer, leader, store, placement, and health information.

04

Protect BR backups and logs

Retain snapshots, log backups, keys, manifests, and timestamps.

NEPFOSYS process

How a data-first evaluation proceeds.

01

Region-to-store mapping

NEPFOSYS identifies which unavailable Regions depend on each failed store.

02

Raft-state preservation

All candidate peer data and PD metadata are protected.

03

Loss-aware validation

Recovered key ranges are checked for table and transaction completeness.

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.

What does Online Unsafe Recovery mean?

It is a documented lossy procedure for Regions whose required stores are permanently damaged.

Can TiDB keep serving other tables?

Yes. Regions with a healthy leader can continue while others are unavailable.

Should I wipe a failed TiKV node before replacing it?

No. Preserve it because its peers may contain unique committed data.

DFW local · Nationwide mail-in

Protect the device. Start with the facts.

Start my recovery case