Skip to content

Commit

Permalink
Update TiKV store status information (#6949)
Browse files Browse the repository at this point in the history
  • Loading branch information
en-jin19 authored Mar 31, 2022
1 parent 01ebf86 commit f38041c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
6 changes: 6 additions & 0 deletions faq/deploy-and-maintain-faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,12 @@ PD can tolerate any synchronization error, but a larger error value means a larg
The client connection can only access the cluster through TiDB. TiDB connects PD and TiKV. PD and TiKV are transparent to the client. When TiDB connects to any PD, the PD tells TiDB who is the current leader. If this PD is not the leader, TiDB reconnects to the leader PD.
#### What is the relationship between each status (Up, Disconnect, Offline, Down, Tombstone) of a TiKV store?
For the relationship between each status, refer to [Relationship between each status of a TiKV store](/tidb-scheduling.md#information-collection).
You can use PD Control to check the status information of a TiKV store.
#### What is the difference between the `leader-schedule-limit` and `region-schedule-limit` scheduling parameters in PD?
- The `leader-schedule-limit` scheduling parameter is used to balance the Leader number of different TiKV servers, affecting the load of query processing.
Expand Down
Binary file added media/tikv-store-status-relationship.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion pd-control.md
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,8 @@ Usage:
> **Note:**
>
> When you use the `store limit` command, the original `region-add` and `region-remove` are deprecated. Use `add-peer` and `remove-peer` instead.
> - The original `region-add` and `region-remove` parameters of the `store limit` command are deprecated and are replaced with `add-peer` and `remove-peer`.
> - You can use `pd-ctl` to check the status (Up, Disconnect, Offline, Down, or Tombstone) of a TiKV store. For the relationship between each status, refer to [Relationship between each status of a TiKV store](/tidb-scheduling.md#information-collection).
### `log [fatal | error | warn | info | debug]`
Expand Down
10 changes: 10 additions & 0 deletions tidb-scheduling.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,16 @@ Scheduling is based on information collection. In short, the PD scheduling compo
* Whether the store is overloaded
* Labels (See [Perception of Topology](/schedule-replicas-by-topology-labels.md))

You can use PD control to check the status of a TiKV store, which can be Up, Disconnect, Offline, Down, or Tombstone. The following is a description of all statuses and their relationship.

+ **Up**: The TiKV store is in service.
+ **Disconnect**: Heartbeat messages between the PD and the TiKV store are lost for more than 20 seconds. If the lost period exceeds the time specified by `max-store-down-time`, the status "Disconnect" changes to "Down".
+ **Down**: Heartbeat messages between the PD and the TiKV store are lost for a time longer than `max-store-down-time` (30 minutes by default). In this status, the TiKV store starts replenishing replicas of each Region on the surviving store.
+ **Offline**: A TiKV store is manually taken offline through PD Control. This is only an intermediate status for the store to go offline. The store in this status moves all its Regions to other "Up" stores that meet the relocation conditions. When `leader_count` and `region_count` (obtained through PD Control) both show `0`, the store status changes to "Tombstone" from "Offline". In the "Offline" status, **do not** disable the store service or the physical server where the store is located. During the process that the store goes offline, if the cluster does not have target stores to relocate the Regions (for example, inadequate stores to hold replicas in the cluster), the store is always in the "Offline" status.
+ **Tombstone**: The TiKV store is completely offline. You can use the `remove-tombstone` interface to safely clean up TiKV in this status.

![TiKV store status relationship](/media/tikv-store-status-relationship.png)

- Information reported by Region leaders:

Each Region leader sends heartbeats to PD periodically to report [`RegionState`](https://github.com/pingcap/kvproto/blob/master/proto/pdpb.proto#L312), including:
Expand Down

0 comments on commit f38041c

Please sign in to comment.