mirror of
https://github.com/minio/minio.git
synced 2024-12-24 22:25:54 -05:00
replication resync: report only the on-disk status (#18017)
Avoid reporting in-memory status since results can vary if different nodes are queried, resync always runs at a single node.
This commit is contained in:
parent
8b8be2695f
commit
18e23bafd9
@ -476,27 +476,17 @@ func (api objectAPIHandlers) ResetBucketReplicationStatusHandler(w http.Response
|
|||||||
writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL)
|
writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
var tgtStats map[string]TargetReplicationResyncStatus
|
brs, err := loadBucketResyncMetadata(ctx, bucket, objectAPI)
|
||||||
globalReplicationPool.resyncer.RLock()
|
if err != nil {
|
||||||
brs, ok := globalReplicationPool.resyncer.statusMap[bucket]
|
writeErrorResponse(ctx, w, errorCodes.ToAPIErrWithErr(ErrBadRequest, InvalidArgument{
|
||||||
if ok {
|
Bucket: bucket,
|
||||||
tgtStats = brs.cloneTgtStats()
|
Err: fmt.Errorf("replication resync status not available for %s (%s)", arn, err.Error()),
|
||||||
}
|
}), r.URL)
|
||||||
globalReplicationPool.resyncer.RUnlock()
|
return
|
||||||
if !ok {
|
|
||||||
brs, err = loadBucketResyncMetadata(ctx, bucket, objectAPI)
|
|
||||||
if err != nil {
|
|
||||||
writeErrorResponse(ctx, w, errorCodes.ToAPIErrWithErr(ErrBadRequest, InvalidArgument{
|
|
||||||
Bucket: bucket,
|
|
||||||
Err: fmt.Errorf("No replication resync status available for %s", arn),
|
|
||||||
}), r.URL)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
tgtStats = brs.cloneTgtStats()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var rinfo ResyncTargetsInfo
|
var rinfo ResyncTargetsInfo
|
||||||
for tarn, st := range tgtStats {
|
for tarn, st := range brs.TargetsMap {
|
||||||
if arn != "" && tarn != arn {
|
if arn != "" && tarn != arn {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user