How to View the List of PD Nodes Cached by the PD Client in TiKV

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 怎么查看TiKV 中的 PD Client 缓存的 PD 节点列表

| username: TiDBer_yUoxD0vR

[TiDB Usage Environment] Production Environment / Testing / PoC
[TiDB Version]
[Reproduction Path] What operations were performed that led to the issue
[Encountered Issue: Issue Phenomenon and Impact]
The documentation states, “The PD Client in TiKV caches the PD node list, but currently does not automatically update it periodically,” and “After scaling PD, the PD cluster must include at least two PD node members that existed before the scaling operation.” How can I view the current list of PDs cached by TiKV? How can I know if TiKV has cached the two PD members from before the scaling?

[Resource Configuration] Go to TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
[Attachments: Screenshots/Logs/Monitoring]

| username: buptzhoutian | Original post link

The document in the screenshot is probably quite old. More recent versions of TiKV have a mechanism for periodically and automatically updating PD nodes.

| username: tidb菜鸟一只 | Original post link

After scaling PD, the PD cluster must include at least two PD node members that existed before the scaling operation. This means that if your original cluster had more than two PD nodes, you do not need to perform a PD leader switch operation after scaling out, and if more than two nodes remain after scaling in, you also do not need to perform a switch operation. However, if there was only one node, you need to perform a PD leader switch operation after scaling out.

| username: TiDBer_yUoxD0vR | Original post link

The cluster’s PD has been migrated many times, and I’m not sure if it was switched before. Now it needs to be migrated again. If it is not switched, what impact will it have if TiKV caches the previously non-existent PD nodes?

| username: redgame | Original post link

SELECT * FROM INFORMATION_SCHEMA.TIDB_CLUSTERS;

| username: tidb菜鸟一只 | Original post link

SELECT * FROM INFORMATION_SCHEMA.CLUSTER_INFO; According to my understanding, this is to check what PD information is in the database, and this information is stored on TiKV.

| username: TiDBer_yUoxD0vR | Original post link

3.0 does not have this table.

| username: h5n1 | Original post link

There is no way to see it, CLUSTER_INFO is also information obtained by contacting PD.

| username: tidb菜鸟一只 | Original post link

You can manually switch the PD leader first; this operation is not very risky.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.