456
457
if len(oldEntries) > 0 {
458
>
// Build a candidate map, validate it, and only commit on success.
metadata.go
459
>
// A bad row in cluster_metadata must not be able to crash the refresher
460
>
// or corrupt the in-memory state.
461
>
candidate := maps.Clone(clusterInfoMap)
462
>
applyClusterInfoUpdates(candidate, oldEntries, newEntries)
463
>
newVersionMap, err := updateVersionToClusterName(candidate, m.failoverVersionIncrement)
464
>
if err != nil {
465
return fmt.Errorf("rejecting cluster metadata refresh: %w", err)
466
}