Inaccurate Region Information in Monitoring

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

Original topic: 监控中region信息不准确

| username: h5n1

Bug Report
Clearly and accurately describe the issue you found. Providing any steps to reproduce the issue can help the development team address it promptly.
[TiDB Version] 5.x 6.x
[Impact of the Bug]

[Possible Steps to Reproduce the Issue]
Inaccurate region information in monitoring
[Observed Unexpected Behavior]
The number of regions in PD on the TiKV overview page is 490,000 for 10 TiKVs.
680e09b37e6c055bc94d488e5d1da1a

However, the monitoring shows 147,000 regions per node, which totals 1.47 million for 10 TiKVs. It should be divided by 3. The leader count is correct at 49,000 per TiKV.

[Expected Behavior]

[Related Components and Specific Versions]

[Other Background Information or Screenshots]
Such as cluster topology, system and kernel version, application app information, etc. If the issue is related to SQL, please provide the SQL statements and related table schema information. If there are critical errors in the node logs, please provide the relevant log content or files. If some business-sensitive information is inconvenient to provide, please leave contact information, and we will communicate with you privately.

| username: TiDBer_jYQINSnf | Original post link

The relationship of Region{ peer, peer, peer} means that the number of regions seen in each TiKV is actually a peer of that region. The number of leaders is the role of the leader among these peers.

That is,
tikv1: region1.peer1, region2.peer1, region3.peer1
tikv2: region1.peer2, region2.peer2, region3.peer2
tikv3: region1.peer3, region2.peer2, region3.peer3

From this perspective, saying that there are 3 regions on each TiKV is correct.
And the leaders are evenly distributed among the 3, so saying that there is 1 region on each TiKV is also correct.

From the PD’s perspective, PD counts region1, region2, and region3. So PD considers there to be a total of 3 regions.

This is my understanding :grin:

| username: h5n1 | Original post link

That’s the logic. It feels like it should be called “region peer” to be more accurate.

| username: TiDBer_jYQINSnf | Original post link

It is probably also a concern that introducing too many concepts will cause confusion.

| username: Lucien-卢西恩 | Original post link

Is this the number of single-replica regions? Is there any issue with it?

| username: h5n1 | Original post link

There is no problem with PD, the issue lies with the number of regions in TiKV. It feels more appropriate to call it region peer.

| username: h5n1 | Original post link

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