Use decrypted object size while computing object size summary (#17717)

Corrects an issue with encrypted versioned objects being reported under
`unversioned` bin in the object version histogram
This commit is contained in:
Poorna 2023-07-24 20:13:25 -04:00 committed by GitHub
parent c32c71c836
commit f95129894d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -551,11 +551,12 @@ func (s *xlStorage) NSScanner(ctx context.Context, cache dataUsageCache, updates
for _, oi := range objInfos {
done = globalScannerMetrics.time(scannerMetricApplyVersion)
sz := item.applyActions(ctx, objAPI, oi, &sizeS)
actualSz, _ := oi.GetActualSize()
done()
if oi.DeleteMarker {
sizeS.deleteMarkers++
}
if oi.VersionID != "" && sz == oi.Size {
if oi.VersionID != "" && sz == actualSz {
sizeS.versions++
}
sizeS.totalSize += sz