site replication: cancel ongoing op properly (#17428)

This commit is contained in:
Poorna 2023-06-15 08:05:08 -07:00 committed by GitHub
parent 6278679ffd
commit a9082e4f79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5169,6 +5169,10 @@ func (c *SiteReplicationSys) cancelResync(ctx context.Context, objAPI ObjectLaye
if err := saveSiteResyncMetadata(ctx, rs, objAPI); err != nil {
return res, err
}
select {
case globalReplicationPool.resyncer.resyncCancelCh <- struct{}{}:
case <-ctx.Done():
}
globalSiteResyncMetrics.updateState(rs)