415
}
416
417
>
func (m *metadataImpl) refreshClusterMetadata(ctx context.Context) error {
metadata.go
418
>
clusterMetadataMap, err := m.listAllClusterMetadataFromDB(ctx)
419
>
if err != nil {
420
return err
421
}
422
423
>
oldEntries := make(map[string]*ClusterInformation)
metadata.go
424
>
newEntries := make(map[string]*ClusterInformation)
425
>
426
>
clusterInfoMap := m.GetAllClusterInfo()
427
>
for clusterName, newClusterInfo := range clusterMetadataMap {
428
>
oldClusterInfo, ok := clusterInfoMap[clusterName]
429
>
if !ok {
430
// handle new cluster registry
431
oldEntries[clusterName] = nil
432
newEntries[clusterName] = ShallowCopyClusterInformation(newClusterInfo)
433
>
} else if newClusterInfo.version > oldClusterInfo.version {
metadata.go
434
if newClusterInfo.Enabled == oldClusterInfo.Enabled &&
435
newClusterInfo.ReplicationEnabled == oldClusterInfo.ReplicationEnabled &&