Fix list entry deduplication (#12325)

File infos would always be the same.

Add numversions as a final tiebreaker.
This commit is contained in:
Klaus Post 2021-05-19 18:21:18 +02:00 committed by GitHub
parent 4f5d75f22b
commit c2c803dd30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -189,11 +189,16 @@ func (z *erasureServerPools) listPath(ctx context.Context, o listPathOptions) (e
if err != nil {
return true
}
oFIV, err := existing.fileInfo(o.Bucket)
oFIV, err := other.fileInfo(o.Bucket)
if err != nil {
return false
}
return oFIV.ModTime.After(eFIV.ModTime)
// Replace if modtime is newer
if !oFIV.ModTime.Equal(eFIV.ModTime) {
return oFIV.ModTime.After(eFIV.ModTime)
}
// Use NumVersions as a final tiebreaker.
return oFIV.NumVersions > eFIV.NumVersions
})
if entries.len() > o.Limit {
allAtEOF = false