After Adding a TiKV Node, Leader and Region Count Balancing is Not Performed

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

Original topic: 添加一个tikv节点后不进行leader和region_count平衡

| username: TiDBer_Y2d2kiJh

[Test Environment] Testing environment
[TiDB Version] v5.4.0
[Reproduction Path] After expanding a TiKV node, it shows that the expansion was successful, but the leader and region_count data remain at 0. How can I troubleshoot this issue?
[Encountered Problem: Phenomenon and Impact]
[Resource Configuration]
[Attachment: Screenshot/Log/Monitoring]

| username: TiDBer_Y2d2kiJh | Original post link

This issue was tested by adding a TiKV node to a 3-node, 3-replica cluster. After adding the node, both the leader and region counts were 0, and no data balancing occurred. When one of the original three TiKV nodes was scaled down, data started to balance to the new node, specifically balancing the data from the scaled-down node to the newly added node. Therefore, the subsequently added TiKV nodes will balance the data from the scaled-down node. When multiple TiKV nodes are added, they will evenly distribute the data from the last scaled-down node.

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

Did you specify the label for the TiKV node? Please share the configuration file of the cluster’s TiKV.

| username: Fly-bird | Original post link

We need to wait a bit longer.

| username: TiDBer_Y2d2kiJh | Original post link

The newly added ones don’t have a specified label.

| username: TiDBer_Y2d2kiJh | Original post link

It’s been a day, and it’s still not balanced.

| username: 像风一样的男子 | Original post link

Take a look at the operator screenshot under tsp-prod-tidb-cluster-PD in the granafa monitoring.

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

Try labeling the new nodes with the host label.

| username: TiDBer_Y2d2kiJh | Original post link

As soon as it was added, it started balancing. :+1:

| username: TiDBer_Y2d2kiJh | Original post link

Please advise how you add the label. I added it in the tiup cluster edit-config aaa file and then need to reload this TiKV node, but in a production environment, you can’t just reload TiKV nodes, right?

| username: zhanggame1 | Original post link

Of course, you can reload without a leader on it.

| username: TiDBer_Y2d2kiJh | Original post link

There is already a leader in another environment, not this one.

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

You must reload the cluster after adding a label, otherwise the label will not take effect.

| username: TiDBer_Y2d2kiJh | Original post link

Is there a way to add a label when adding a new TiKV?

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

You can directly write the label in the configuration file.

| username: TiDBer_Y2d2kiJh | Original post link

Yes, you can just write it in the configuration file.

| username: system | Original post link

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