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:
Anis Eleuch 2025-04-03 23:07:24 +01:00 committed by GitHub
parent f2c9eb0f79
commit eafeb27e90
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1182,29 +1182,32 @@ func (z *erasureServerPools) checkAfterDecom(ctx context.Context, idx int) error
return 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) fivs, err := entry.fileInfoVersions(bi.Name)
if err != nil { if err != nil {
return return
} }
// We need a reversed order for decommissioning, var ignored int
// to create the appropriate stack.
versionsSorter(fivs.Versions).reverse()
for _, version := range fivs.Versions { for _, version := range fivs.Versions {
// Apply lifecycle rules on the objects that are expired. // Apply lifecycle rules on the objects that are expired.
if filterLifecycle(bi.Name, version.Name, version) { if filterLifecycle(bi.Name, version.Name, version) {
ignored++
continue continue
} }
if version.Deleted {
// `.usage-cache.bin` still exists, must be not readable ignore it. ignored++
if bi.Name == minioMetaBucket && strings.Contains(version.Name, dataUsageCacheName) {
// skipping bucket usage cache name, as its autogenerated.
continue continue
} }
versionsFound++
} }
versionsFound += len(fivs.Versions) - ignored
}); err != nil { }); err != nil {
return err return err
} }