Fix admin GUI list ordering on refresh (#7782)
Sort lists of filers, volume servers, masters, and message brokers by address to ensure consistent ordering on page refresh. This fixes the non-deterministic ordering caused by iterating over Go maps with range. Fixes #7781
This commit is contained in:
@@ -544,6 +544,11 @@ func (s *AdminServer) GetClusterVolumeServers() (*ClusterVolumeServersData, erro
|
||||
volumeServers = append(volumeServers, *vs)
|
||||
}
|
||||
|
||||
// Sort volume servers by address for consistent ordering on page refresh
|
||||
sort.Slice(volumeServers, func(i, j int) bool {
|
||||
return volumeServers[i].GetDisplayAddress() < volumeServers[j].GetDisplayAddress()
|
||||
})
|
||||
|
||||
var totalCapacity int64
|
||||
var totalVolumes int
|
||||
for _, vs := range volumeServers {
|
||||
|
||||
Reference in New Issue
Block a user