mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
fix site replication resync status (#18245)
To persist status changes on disk upon completion. Adds new tests to handle this functionality.
This commit is contained in:
@@ -5157,8 +5157,7 @@ func (c *SiteReplicationSys) startResync(ctx context.Context, objAPI ObjectLayer
|
||||
}
|
||||
}()
|
||||
|
||||
globalSiteResyncMetrics.updateState(rs)
|
||||
if err := saveSiteResyncMetadata(ctx, rs, objAPI); err != nil {
|
||||
if err := globalSiteResyncMetrics.updateState(rs); err != nil {
|
||||
return res, err
|
||||
}
|
||||
|
||||
@@ -5408,6 +5407,9 @@ func loadSiteResyncMetadata(ctx context.Context, objAPI ObjectLayer, dID string)
|
||||
|
||||
// save resync status of peer to resync/depl-id.meta
|
||||
func saveSiteResyncMetadata(ctx context.Context, ss SiteResyncStatus, objectAPI ObjectLayer) error {
|
||||
if objectAPI == nil {
|
||||
return errSRObjectLayerNotReady
|
||||
}
|
||||
data := make([]byte, 4, ss.Msgsize()+4)
|
||||
|
||||
// Initialize the resync meta header.
|
||||
|
||||
Reference in New Issue
Block a user