replication resync: fix queueing (#17775)
Assign resync of all versions of object to the same worker to avoid locking contention. Fixes parallel resync implementation in #16707
This commit is contained in:
@@ -292,22 +292,22 @@ func siteResyncStatus(currSt ResyncStatusType, m map[string]ResyncStatusType) Re
|
||||
}
|
||||
|
||||
// update resync metrics per object
|
||||
func (sm *siteResyncMetrics) updateMetric(roi ReplicateObjectInfo, success bool, resyncID string) {
|
||||
func (sm *siteResyncMetrics) updateMetric(r TargetReplicationResyncStatus, resyncID string) {
|
||||
if !globalSiteReplicationSys.isEnabled() {
|
||||
return
|
||||
}
|
||||
sm.Lock()
|
||||
defer sm.Unlock()
|
||||
s := sm.resyncStatus[resyncID]
|
||||
if success {
|
||||
if r.ReplicatedCount > 0 {
|
||||
s.ReplicatedCount++
|
||||
s.ReplicatedSize += roi.Size
|
||||
s.ReplicatedSize += r.ReplicatedSize
|
||||
} else {
|
||||
s.FailedCount++
|
||||
s.FailedSize += roi.Size
|
||||
s.FailedSize += r.FailedSize
|
||||
}
|
||||
s.Bucket = roi.Bucket
|
||||
s.Object = roi.Name
|
||||
s.Bucket = r.Bucket
|
||||
s.Object = r.Object
|
||||
s.LastUpdate = UTCNow()
|
||||
sm.resyncStatus[resyncID] = s
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user