Can the current ID allocation be obtained from places other than monitoring and PD logs?

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

Original topic: Current ID allocation 除了从监控中和PD日志中获取,还能再别的地方获取到吗

| username: ffeenn

【TiDB Usage Environment】Production Environment / Testing / PoC
【TiDB Version】
【Reproduction Path】What operations were performed when the issue occurred
【Encountered Issue: Issue Symptoms and Impact】
【Resource Configuration】
【Attachments: Screenshots / Logs / Monitoring】

| username: xfworld | Original post link

With ETCD, it will be more complicated…

The prerequisite is that the PD leader is not down…

| username: 小龙虾爱大龙虾 | Original post link

Check the region ID allocation, add a 1 to the highest bit, this way it shouldn’t conflict.

| username: ffeenn | Original post link

Completely crashed.

| username: ffeenn | Original post link

Okay, give it a try, it might not work very well.

| username: xfworld | Original post link

Then you can only look for it in the logs. If you can’t find it, just create a larger ID yourself…

| username: dba远航 | Original post link

How about trying UUID()?

| username: wangccsy | Original post link

I haven’t had the chance to practice in the environment yet.

| username: Jayjlchen | Original post link

Every PD log has it, so it is guaranteed not to be lost.

Reference:
Method 1:

cat /u01/tidb/deploy/pd-2379/log/pd.log | grep "init cluster id"
[2024/01/17 11:49:47.039 +08:00] [INFO] [server.go:346] ["init cluster id"] [cluster-id=7212470665861270901]

Method 2:

tiup ctl:v6.5.7 pd -u ip:port store --jq=".stores[] | {id: .store.id, address: .store.address, state_name: .store.state_name, capacity: .status.capacity, available: .status.available, region_count: .status.region_count}"
| username: ffeenn | Original post link

If there were logs, I wouldn’t be asking.

| username: system | Original post link

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