A TiDB server stops
TiDB servers hold no data, so the load balancer sends new connections to the others. Open sessions on the failed server end, and any transaction in flight on them is lost.
We check health probes on the load balancer and test that your connection pools reconnect and retry. TiProxy keeps sessions only through planned restarts and scale-in, not a crash.
A TiKV node fails
For each Region it led, the surviving replicas elect a new Raft leader and requests retry against it. If the node stays down past max-store-down-time (30m by default), PD rebuilds its replicas on other nodes.
We keep enough free disk and CPU on the remaining TiKV nodes to take those replicas, and alert on Regions with a missing replica.
The PD leader fails
The other PD members elect a new leader. Every transaction needs a timestamp from the PD leader, so new transactions wait until the election finishes.
We run three or five PD members in separate zones, check that the leader sits near the TiDB servers, and set leader priorities where it should stay put.
A whole zone goes down
With three zones, three replicas, and correct labels, each Region keeps two of three replicas and stays writable. Without labels, PD can place two replicas of a Region in one zone.
We set location-labels and isolation-level in PD, match them to each TiKV node's labels, and confirm the spread with pd-ctl before relying on it.
A TiFlash node fails
TiFlash replicas are asynchronous Raft learners, so writes and transactional reads on TiKV carry on. Queries that depend on that table's columnar replica lose it until it is rebuilt.
We set two TiFlash replicas, on separate nodes, for tables that dashboards or reports depend on, and watch replica status in information_schema.
A Region loses most of its replicas
Raft cannot elect a leader, so that data is unavailable. Online Unsafe Recovery brings it back online but can lose data and leave indexes inconsistent.
We agree in advance when to use Online Unsafe Recovery and when to restore from BR instead, and run ADMIN CHECK TABLE afterward.