mirror of
https://github.com/minio/minio.git
synced 2025-11-07 21:02:58 -05:00
Skip versions expired by DeleteAllVersionsAction (#18537)
Object versions expired by DeleteAllVersionsAction must not be included toward data-usage accounting.
This commit is contained in:
committed by
GitHub
parent
b0264bdb90
commit
9fbd931058
@@ -567,11 +567,19 @@ func (s *xlStorage) NSScanner(ctx context.Context, cache dataUsageCache, updates
|
||||
|
||||
versioned := vcfg != nil && vcfg.Versioned(item.objectPath())
|
||||
|
||||
var objDeleted bool
|
||||
for _, oi := range objInfos {
|
||||
done = globalScannerMetrics.time(scannerMetricApplyVersion)
|
||||
sz := item.applyActions(ctx, objAPI, oi, &sizeS)
|
||||
var sz int64
|
||||
objDeleted, sz = item.applyActions(ctx, objAPI, oi, &sizeS)
|
||||
done()
|
||||
|
||||
// DeleteAllVersionsAction: The object and all its
|
||||
// versions are expired and
|
||||
// doesn't contribute toward data usage.
|
||||
if objDeleted {
|
||||
break
|
||||
}
|
||||
actualSz, err := oi.GetActualSize()
|
||||
if err != nil {
|
||||
continue
|
||||
@@ -644,6 +652,12 @@ func (s *xlStorage) NSScanner(ctx context.Context, cache dataUsageCache, updates
|
||||
}
|
||||
}
|
||||
}
|
||||
if objDeleted {
|
||||
// we return errIgnoreFileContrib to signal this function's
|
||||
// callers to skip this object's contribution towards
|
||||
// usage.
|
||||
return sizeSummary{}, errIgnoreFileContrib
|
||||
}
|
||||
return sizeS, nil
|
||||
}, scanMode)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user