replication: Simplify mrf requeueing and add backlog handler (#17171)

Simplify MRF queueing and add backlog handler

- Limit re-tries to 3 to avoid repeated re-queueing. Fall offs
to be re-tried when the scanner revisits this object or upon access.

- Change MRF to have each node process only its MRF entries.

- Collect MRF backlog by the node to allow for current backlog visibility
This commit is contained in:
Poorna
2023-07-13 02:51:33 -04:00
committed by GitHub
parent 9b9871cfbb
commit 5e2f8d7a42
12 changed files with 389 additions and 67 deletions

View File

@@ -944,3 +944,34 @@ func (client *peerRESTClient) Netperf(ctx context.Context, duration time.Duratio
err = gob.NewDecoder(respBody).Decode(&result)
return result, err
}
// GetReplicationMRF - get replication MRF for bucket
func (client *peerRESTClient) GetReplicationMRF(ctx context.Context, bucket string) (chan madmin.ReplicationMRF, error) {
values := make(url.Values)
values.Set(peerRESTBucket, bucket)
respBody, err := client.callWithContext(ctx, peerRESTMethodGetReplicationMRF, values, nil, -1)
if err != nil {
return nil, err
}
dec := gob.NewDecoder(respBody)
ch := make(chan madmin.ReplicationMRF)
go func(ch chan madmin.ReplicationMRF) {
defer func() {
xhttp.DrainBody(respBody)
close(ch)
}()
for {
var entry madmin.ReplicationMRF
if err := dec.Decode(&entry); err != nil {
return
}
select {
case <-ctx.Done():
return
case ch <- entry:
}
}
}(ch)
return ch, nil
}