tikv-recovery

Resolve TiKV region unavailability and replica majority loss recovery workflows.

Updated Jun 3, 2026
One-click install
npx skills add https://github.com/alex-quan-001/nutshell-skills --skill tikv-recovery
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tikv-recovery
Source: https://github.com/alex-quan-001/nutshell-skills/tree/main/skills/diagnosis/tikv-recovery
Command: npx skills add https://github.com/alex-quan-001/nutshell-skills --skill tikv-recovery

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses critical TiKV cluster failures including region unavailability due to replica majority loss, unsafe recovery workflow failures, persistent orphan peers, and TiFlash-related recovery blockers that impact database uptime and data integrity for on-call engineering teams.

Core Features & Use Cases

  • Unsafe Recovery Workflows: Provides version-specific guidance for both online (v6.1.0+) and manual unsafe recovery procedures, with clear recommendations for stable baseline versions.
  • Edge Case Resolution: Includes workarounds for known recovery blockers such as learner node interference, TiFlash replica conflicts, and post-recovery orphan peer errors.
  • Operational Safeguards: Outlines pre-recovery checks, data loss risk assessment steps, and post-recovery consistency validation to minimize unintended data loss.
  • Use Case: If 2 of 3 TiKV replicas for a region are lost and the cluster reports "Region is unavailable", this Skill guides you through the correct recovery process for your cluster version, including steps to resolve stuck recovery flows caused by TiFlash replicas.

Quick Start

Use the tikv-recovery skill to walk you through the correct unsafe recovery workflow for your TiKV cluster version when regions are unavailable due to majority replica loss, including steps to clean up orphan peers and verify post-recovery cluster consistency.

Frequently Asked Questions about tikv-recovery

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I recover a TiKV region when majority of replicas are lost and it reports unavailable?

TiKV region unavailability from majority replica loss requires unsafe recovery workflows. The correct process depends on your cluster version, utilizing online procedures for v6.1.0+ or manual steps for older versions to restore region availability.

Why does unsafe recovery get stuck or blocked by TiFlash replicas?

TiFlash replica conflicts can block TiKV unsafe recovery progress. Resolving these blockers requires specific workarounds to clear TiFlash interference and allow the region recovery workflow to complete successfully.

What are the steps to clean up orphan peers after TiKV data recovery?

Post-recovery orphan peer errors require targeted remediation to ensure cluster stability. The process involves applying version-specific procedural guidance to clean up persistent orphan peers and validate overall TiKV consistency.

Can I perform online unsafe recovery on older TiKV clusters like v5.0?

Online unsafe recovery is available for TiKV v6.1.0 and later. Clusters running versions between v5.0 and v6.0 require manual unsafe recovery procedures instead of the online workflow.

How do I prevent unintended data loss during TiKV unsafe recovery operations?

Preventing unintended data loss during TiKV unsafe recovery requires strict operational safeguards. You must execute pre-recovery checks, assess data loss risks, and perform post-recovery consistency validation.

What is a TiKV orphan peer and when does it need remediation?

A TiKV orphan peer is a lingering Raft replica left behind after unsafe recovery operations. It needs remediation when persistent orphan peers cause region errors or block normal cluster operations.