mirror of
https://github.com/minio/minio.git
synced 2025-04-06 21:00:40 -04:00
decom: Ignore orphan delete markers in verification stage (#21106)
To make sure that no objects were skipped for any reason, decommissioning does a second phase of listing to check if there are some objects that need to be decommissioned. However, the code forgot to skip orphan delete markers since the decom code already skips it. Make the code ignore delete markers in in the verification phase. Co-authored-by: Anis Eleuch <anis@min.io>
This commit is contained in:
parent
f2c9eb0f79
commit
eafeb27e90
@ -1182,29 +1182,32 @@ func (z *erasureServerPools) checkAfterDecom(ctx context.Context, idx int) error
|
||||
return
|
||||
}
|
||||
|
||||
// `.usage-cache.bin` still exists, must be not readable ignore it.
|
||||
if bi.Name == minioMetaBucket && strings.Contains(entry.name, dataUsageCacheName) {
|
||||
// skipping bucket usage cache name, as its autogenerated.
|
||||
return
|
||||
}
|
||||
|
||||
fivs, err := entry.fileInfoVersions(bi.Name)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
// We need a reversed order for decommissioning,
|
||||
// to create the appropriate stack.
|
||||
versionsSorter(fivs.Versions).reverse()
|
||||
var ignored int
|
||||
|
||||
for _, version := range fivs.Versions {
|
||||
// Apply lifecycle rules on the objects that are expired.
|
||||
if filterLifecycle(bi.Name, version.Name, version) {
|
||||
ignored++
|
||||
continue
|
||||
}
|
||||
|
||||
// `.usage-cache.bin` still exists, must be not readable ignore it.
|
||||
if bi.Name == minioMetaBucket && strings.Contains(version.Name, dataUsageCacheName) {
|
||||
// skipping bucket usage cache name, as its autogenerated.
|
||||
if version.Deleted {
|
||||
ignored++
|
||||
continue
|
||||
}
|
||||
|
||||
versionsFound++
|
||||
}
|
||||
|
||||
versionsFound += len(fivs.Versions) - ignored
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user