View the Number of TiFlash Table Replicas

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

Original topic: TiFlash 数据表副本数查看

| username: rebelsre

[TiDB Usage Environment] Production Environment
[TiDB Version] v7.1.2
[Encountered Issue: Issue Phenomenon and Impact]
Preparing to scale down TiFlash, following the official documentation Using TiUP to Scale TiDB Cluster | PingCAP Documentation Center. When reaching the step to check the number of replicas, due to historical reasons Issue in v7.1.1, upgrading to 7.1.2 did not resolve the TiDB Dashboard SQL page anomaly - :sun_with_face: Suggestions and Feedback / Product Defects - TiDB Q&A Community (asktug.com) leading to the error when executing SELECT * FROM information_schema.tiflash_replica, reporting ERROR 1105 (HY000): runtime error: invalid memory address or nil pointer dereference. I would like to know if there are other methods to check the replica settings to successfully complete the TiFlash scale-down.

Another issue is whether the command ALTER TABLE . SET tiflash replica ‘new_replica_num’; takes effect immediately or requires some waiting time. Although the effectiveness can be checked through the above replica count, it falls into the above issue…

| username: TiDBer_jYQINSnf | Original post link

Check PD using pd-ctl store to see if there are any regions on TiFlash. When this number is 0, the TiFlash can be scaled down.

| username: rebelsre | Original post link

There are other TiFlash nodes. First, expand and then shrink, which is equivalent to machine migration.

| username: JinheLin | Original post link

You can determine if the TiFlash replica is effective by using Grafana monitoring: TiFlash-Summary - Storage - Write Command OPS.

If there are ingest calls, it means that the stock data is still being synchronized. If there are no ingest calls, it means the stock data synchronization is complete.

| username: TiDBer_jYQINSnf | Original post link

Then you should first add a TiFlash, and then execute store delete on the old TiFlash. Don’t worry about the replicas. As long as the number of TiFlash instances is greater than the number of replicas, there won’t be any issues.

| username: rebelsre | Original post link

Okay, thank you.

| username: rebelsre | Original post link

Okay, thank you.

| username: TiDBer_aaO4sU46 | Original post link

Well, you can first expand and then shrink.

| username: system | Original post link

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