Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update the TiKV store status description (#8723) #8726

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
This is an automated cherry-pick of #8723
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
  • Loading branch information
JmPotato authored and ti-chi-bot committed Mar 22, 2022
commit e31085994a39c8c8c2c647a1a36a2ac9b52fa6df
5 changes: 5 additions & 0 deletions pd-control.md
Original file line number Diff line number Diff line change
Expand Up @@ -1168,7 +1168,12 @@ Encoding 格式示例:

> **注意:**
>
<<<<<<< HEAD
> 使用 `store limit` 命令时,原有的 `region-add` 和 `region-remove` 已废弃,请使用 `add-peer` 和 `remove-peer` 来替代。
=======
> * `store limit` 命令原有的 `region-add` 和 `region-remove` 子命令已废弃,请使用 `add-peer` 和 `remove-peer` 来替代。
> * 使用 `pd-ctl` 可以查看 TiKV 节点的状态信息,即 Up,Disconnect,Offline,Down,或 Tombstone。如需查看各个状态之间的关系,请参考 [TiKV Store 状态之间的关系](/tidb-scheduling.md#信息收集)。
>>>>>>> 690312bfa (docs: update the TiKV store status description (#8723))

### `log [fatal | error | warn | info | debug]`

Expand Down
13 changes: 13 additions & 0 deletions tidb-scheduling.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,19 @@ TiKV 节点 (Store) 与 PD 之间存在心跳包,一方面 PD 通过心跳包
* 是否过载
* labels 标签信息(标签是具备层级关系的一系列 Tag,能够[感知拓扑信息](/schedule-replicas-by-topology-labels.md))

<<<<<<< HEAD
=======
通过使用 `pd-ctl` 可以查看到 TiKV Store 的状态信息。TiKV Store 的状态具体分为 Up,Disconnect,Offline,Down,Tombstone。各状态的关系如下:

+ **Up**:表示当前的 TiKV Store 处于提供服务的状态。
+ **Disconnect**:当 PD 和 TiKV Store 的心跳信息丢失超过 20 秒后,该 Store 的状态会变为 Disconnect 状态,当时间超过 `max-store-down-time` 指定的时间后,该 Store 会变为 Down 状态。
+ **Down**:表示该 TiKV Store 与集群失去连接的时间已经超过了 `max-store-down-time` 指定的时间,默认 30 分钟。超过该时间后,对应的 Store 会变为 Down,并且开始在存活的 Store 上补足各个 Region 的副本。
+ **Offline**:当对某个 TiKV Store 通过 PD Control 进行手动下线操作,该 Store 会变为 Offline 状态。该状态只是 Store 下线的中间状态,处于该状态的 Store 会将其上的所有 Region 搬离至其它满足搬迁条件的 Up 状态 Store。当该 Store 的 `leader_count` 和 `region_count` (在 PD Control 中获取) 均显示为 0 后,该 Store 会由 Offline 状态变为 Tombstone 状态。在 Offline 状态下,禁止关闭该 Store 服务以及其所在的物理服务器。下线过程中,如果集群里不存在满足搬迁条件的其它目标 Store(例如没有足够的 Store 能够继续满足集群的副本数量要求),该 Store 将一直处于 Offline 状态。
+ **Tombstone**:表示该 TiKV Store 已处于完全下线状态,可以使用 `remove-tombstone` 接口安全地清理该状态的 TiKV。

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

>>>>>>> 690312bfa (docs: update the TiKV store status description (#8723))
**每个 Raft Group 的 Leader 会定期向 PD 汇报 Region 的状态信息**

每个 Raft Group 的 Leader 和 PD 之间存在心跳包,用于汇报这个 [Region 的状态](https://github.com/pingcap/kvproto/blob/master/proto/pdpb.proto#L312),主要包括下面几点信息:
Expand Down