mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
fix: ListObjectVersions should return ordered Version & DeleteMarker (#9959)
The S3 specification says that versions are ordered in the response of list object versions. mc snapshot needs this to know which version comes first especially when two versions have the same exact last-modified field.
This commit is contained in:
@@ -409,12 +409,9 @@ func (s *xlStorage) CrawlAndGetDataUsage(ctx context.Context, cache dataUsageCac
|
||||
var totalSize int64
|
||||
for _, version := range fivs.Versions {
|
||||
size := item.applyActions(ctx, objAPI, actionMeta{oi: version.ToObjectInfo(item.bucket, item.objectPath())})
|
||||
totalSize += size
|
||||
}
|
||||
|
||||
// Delete markers have no size, nothing to do here.
|
||||
for _, deleted := range fivs.Deleted {
|
||||
item.applyActions(ctx, objAPI, actionMeta{oi: deleted.ToObjectInfo(item.bucket, item.objectPath())})
|
||||
if !version.Deleted {
|
||||
totalSize += size
|
||||
}
|
||||
}
|
||||
|
||||
return totalSize, nil
|
||||
|
||||
Reference in New Issue
Block a user