@@ -104,7 +104,7 @@ 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
- ShardCount int32
107
+ ShardCount int32 `yaml:"-"` // Ignore this field when loading config.
108
108
// private field to track cluster information updates
109
109
version int64
110
110
}
@@ -401,6 +401,7 @@ func (m *metadataImpl) RegisterMetadataChangeCallback(callbackId any, cb Callbac
401
401
Enabled : clusterInfo .Enabled ,
402
402
InitialFailoverVersion : clusterInfo .InitialFailoverVersion ,
403
403
RPCAddress : clusterInfo .RPCAddress ,
404
+ ShardCount : clusterInfo .ShardCount ,
404
405
version : clusterInfo .version ,
405
406
}
406
407
}
@@ -454,6 +455,7 @@ func (m *metadataImpl) refreshClusterMetadata(ctx context.Context) error {
454
455
Enabled : newClusterInfo .Enabled ,
455
456
InitialFailoverVersion : newClusterInfo .InitialFailoverVersion ,
456
457
RPCAddress : newClusterInfo .RPCAddress ,
458
+ ShardCount : newClusterInfo .ShardCount ,
457
459
version : newClusterInfo .version ,
458
460
}
459
461
} else if newClusterInfo .version > oldClusterInfo .version {
@@ -468,12 +470,14 @@ func (m *metadataImpl) refreshClusterMetadata(ctx context.Context) error {
468
470
Enabled : oldClusterInfo .Enabled ,
469
471
InitialFailoverVersion : oldClusterInfo .InitialFailoverVersion ,
470
472
RPCAddress : oldClusterInfo .RPCAddress ,
473
+ ShardCount : oldClusterInfo .ShardCount ,
471
474
version : oldClusterInfo .version ,
472
475
}
473
476
newEntries [clusterName ] = & ClusterInformation {
474
477
Enabled : newClusterInfo .Enabled ,
475
478
InitialFailoverVersion : newClusterInfo .InitialFailoverVersion ,
476
479
RPCAddress : newClusterInfo .RPCAddress ,
480
+ ShardCount : newClusterInfo .ShardCount ,
477
481
version : newClusterInfo .version ,
478
482
}
479
483
}
@@ -577,6 +581,7 @@ func (m *metadataImpl) listAllClusterMetadataFromDB(
577
581
Enabled : getClusterResp .GetIsConnectionEnabled (),
578
582
InitialFailoverVersion : getClusterResp .GetInitialFailoverVersion (),
579
583
RPCAddress : getClusterResp .GetClusterAddress (),
584
+ ShardCount : getClusterResp .GetHistoryShardCount (),
580
585
version : getClusterResp .Version ,
581
586
}
582
587
}
0 commit comments