Commit 3ade263 1 parent 20a5ce3 commit 3ade263 Copy full SHA for 3ade263
File tree 2 files changed +14
-2
lines changed
2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,8 @@ type (
104
104
InitialFailoverVersion int64 `yaml:"initialFailoverVersion"`
105
105
// Address indicate the remote service address(Host:Port). Host can be DNS name.
106
106
RPCAddress string `yaml:"rpcAddress"`
107
+ // Cluster ID allows to explicitly set the ID of the cluster. Optional.
108
+ ClusterID string `yaml:"-"`
107
109
ShardCount int32 `yaml:"-"` // Ignore this field when loading config.
108
110
// private field to track cluster information updates
109
111
version int64
Original file line number Diff line number Diff line change @@ -662,11 +662,21 @@ func ApplyClusterMetadataConfigProvider(
662
662
tag .Key ("clusterInformation" ),
663
663
tag .ClusterName (clusterName ),
664
664
tag .IgnoredValue (clusterInfo ))
665
+
666
+ // Only configure current cluster metadata from static config file
665
667
continue
666
668
}
667
669
668
- // Only configure current cluster metadata from static config file
669
- clusterId := uuid .New ()
670
+ var clusterId string
671
+ if uuid .Parse (clusterInfo .ClusterID ) == nil {
672
+ if clusterInfo .ClusterID != "" {
673
+ logger .Warn ("Cluster Id in Cluster Metadata config is not a valid uuid. Generating a new Cluster Id" )
674
+ }
675
+ clusterId = uuid .New ()
676
+ } else {
677
+ clusterId = clusterInfo .ClusterID
678
+ }
679
+
670
680
applied , err := clusterMetadataManager .SaveClusterMetadata (
671
681
ctx ,
672
682
& persistence.SaveClusterMetadataRequest {
You can’t perform that action at this time.
0 commit comments