fix: list operations resuming when hitting different node (#19494)

The rest of the peer clients were not consistent across nodes. So, meta cache requests 
would not go to the same server if a continuation happens on a different node.
This commit is contained in:
Klaus Post 2024-04-12 11:13:36 -07:00 committed by GitHub
parent 87299eba10
commit e7baf78ee8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 12 deletions

View File

@ -1104,24 +1104,13 @@ func (sys *NotificationSys) ServerInfo(metrics bool) []madmin.ServerProperties {
return reply
}
// returns all the peers that are currently online.
func (sys *NotificationSys) getOnlinePeers() []*peerRESTClient {
var peerClients []*peerRESTClient
for _, peerClient := range sys.allPeerClients {
if peerClient != nil && peerClient.IsOnline() {
peerClients = append(peerClients, peerClient)
}
}
return peerClients
}
// restClientFromHash will return a deterministic peerRESTClient based on s.
// Will return nil if client is local.
func (sys *NotificationSys) restClientFromHash(s string) (client *peerRESTClient) {
if len(sys.peerClients) == 0 {
return nil
}
peerClients := sys.getOnlinePeers()
peerClients := sys.allPeerClients
if len(peerClients) == 0 {
return nil
}