decom: Ignore object/version error during deletion (#15806)

This commit is contained in:
Anis Elleuch 2022-10-06 17:41:58 +01:00 committed by GitHub
parent 78385bfbeb
commit 158d0e26a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -768,6 +768,10 @@ func (z *erasureServerPools) decommissionPool(ctx context.Context, idx int, pool
DeleteMarker: true, // make sure we create a delete marker
SkipDecommissioned: true, // make sure we skip the decommissioned pool
})
if isErrObjectNotFound(err) || isErrVersionNotFound(err) {
// object/version already deleted by the application, nothing to do here we move on.
continue
}
var failure bool
if err != nil {
logger.LogIf(ctx, err)
@ -783,7 +787,7 @@ func (z *erasureServerPools) decommissionPool(ctx context.Context, idx int, pool
continue
}
var failure bool
var failure, ignore bool
// gr.Close() is ensured by decommissionObject().
for try := 0; try < 3; try++ {
gr, err := set.GetObjectNInfo(ctx,
@ -796,9 +800,10 @@ func (z *erasureServerPools) decommissionPool(ctx context.Context, idx int, pool
VersionID: version.VersionID,
NoDecryption: true,
})
if isErrObjectNotFound(err) {
if isErrObjectNotFound(err) || isErrVersionNotFound(err) {
// object deleted by the application, nothing to do here we move on.
return
ignore = true
break
}
if err != nil {
failure = true
@ -816,6 +821,9 @@ func (z *erasureServerPools) decommissionPool(ctx context.Context, idx int, pool
failure = false
break
}
if ignore {
continue
}
z.poolMetaMutex.Lock()
z.poolMeta.CountItem(idx, version.Size, failure)
z.poolMetaMutex.Unlock()