1
0
mirror of https://github.com/minio/minio.git synced 2025-04-04 11:50:36 -04:00

retry each object decom upto 3 times, in-case of failure ()

This commit is contained in:
Krishna Srinivas 2022-05-11 11:37:32 -07:00 committed by GitHub
parent 83071a3459
commit e34ca9acd1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -687,6 +687,9 @@ func (z *erasureServerPools) decommissionPool(ctx context.Context, idx int, pool
continue continue
} }
var failure bool
// gr.Close() is ensured by decommissionObject().
for try := 0; try < 3; try++ {
gr, err := set.GetObjectNInfo(ctx, gr, err := set.GetObjectNInfo(ctx,
bName, bName,
encodeDirObject(version.Name), encodeDirObject(version.Name),
@ -697,17 +700,17 @@ func (z *erasureServerPools) decommissionPool(ctx context.Context, idx int, pool
VersionID: version.VersionID, VersionID: version.VersionID,
}) })
if err != nil { if err != nil {
logger.LogIf(ctx, err)
z.poolMetaMutex.Lock()
z.poolMeta.CountItem(idx, version.Size, true)
z.poolMetaMutex.Unlock()
break // break out on first error
}
var failure bool
// gr.Close() is ensured by decommissionObject().
if err = z.decommissionObject(ctx, bName, gr); err != nil {
logger.LogIf(ctx, err)
failure = true failure = true
logger.LogIf(ctx, err)
continue
}
if err = z.decommissionObject(ctx, bName, gr); err != nil {
failure = true
logger.LogIf(ctx, err)
continue
}
failure = false
break
} }
z.poolMetaMutex.Lock() z.poolMetaMutex.Lock()
z.poolMeta.CountItem(idx, version.Size, failure) z.poolMeta.CountItem(idx, version.Size, failure)