mirror of
https://github.com/minio/minio.git
synced 2025-01-25 13:43:17 -05:00
bucket resync: persist reset id to bucket metadata (#16088)
This commit is contained in:
parent
3661aaf8a1
commit
7198be5be9
@ -321,6 +321,21 @@ func (api objectAPIHandlers) ResetBucketReplicationStartHandler(w http.ResponseW
|
|||||||
writeErrorResponseJSON(ctx, w, toAPIError(ctx, err), r.URL)
|
writeErrorResponseJSON(ctx, w, toAPIError(ctx, err), r.URL)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
targets, err := globalBucketTargetSys.ListBucketTargets(ctx, bucket)
|
||||||
|
if err != nil {
|
||||||
|
writeErrorResponseJSON(ctx, w, toAPIError(ctx, err), r.URL)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
tgtBytes, err := json.Marshal(&targets)
|
||||||
|
if err != nil {
|
||||||
|
writeErrorResponseJSON(ctx, w, errorCodes.ToAPIErrWithErr(ErrAdminConfigBadJSON, err), r.URL)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if _, err = globalBucketMetadataSys.Update(ctx, bucket, bucketTargetsFile, tgtBytes); err != nil {
|
||||||
|
writeErrorResponseJSON(ctx, w, toAPIError(ctx, err), r.URL)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if err := globalReplicationPool.resyncer.start(ctx, objectAPI, resyncOpts{
|
if err := globalReplicationPool.resyncer.start(ctx, objectAPI, resyncOpts{
|
||||||
bucket: bucket,
|
bucket: bucket,
|
||||||
arn: arn,
|
arn: arn,
|
||||||
|
@ -221,6 +221,9 @@ func (sm *siteResyncMetrics) incBucket(o resyncOpts, bktStatus ResyncStatusType)
|
|||||||
defer sm.Unlock()
|
defer sm.Unlock()
|
||||||
st, ok := sm.resyncStatus[o.resyncID]
|
st, ok := sm.resyncStatus[o.resyncID]
|
||||||
if ok {
|
if ok {
|
||||||
|
if st.BucketStatuses == nil {
|
||||||
|
st.BucketStatuses = map[string]ResyncStatusType{}
|
||||||
|
}
|
||||||
switch bktStatus {
|
switch bktStatus {
|
||||||
case ResyncCompleted:
|
case ResyncCompleted:
|
||||||
st.BucketStatuses[o.bucket] = ResyncCompleted
|
st.BucketStatuses[o.bucket] = ResyncCompleted
|
||||||
|
Loading…
x
Reference in New Issue
Block a user