ClusterID
has been saved in too many places
#8588
Labels
type/enhancement
The issue or PR belongs to an enhancement.
ClusterID
has been saved in too many places
#8588
Enhancement Task
ClusterID
is the ID which is initialized beforestartServer
. It is initialized once during the serving.ClusterID
initpd/server/server.go
Line 436 in 8571ca4
After this, all operations on
ClusterID
are read operations. To read it, PD passed the ClusterId layer by layer and saved it.pd/server/server.go
Line 493 in 8571ca4
pd/server/server.go
Line 503 in 8571ca4
pd/server/server.go
Line 507 in 8571ca4
pd/pkg/mcs/metastorage/server/manager.go
Line 51 in 8571ca4
pd/pkg/mcs/scheduling/server/meta/watcher.go
Line 61 in 8571ca4
pd/pkg/mcs/scheduling/server/cluster.go
Line 100 in 8571ca4
Strongly related to the
ClusterID
is therootPath
field, which is also passed and stored hierarchically.pd/server/server.go
Line 442 in 8571ca4
For
ClusterID
, a better way is to use a global variable so that we can clearly know where it was modified and where it was used.The text was updated successfully, but these errors were encountered: