mirror of
https://github.com/minio/minio.git
synced 2025-01-11 15:03:22 -05:00
xl: Tree walking should not quit when one disk returns empty (#9160)
Currently, a tree walking, needed to a list objects in a specific set quits listing as long as it finds no entries in a disk, which is wrong. This affected background healing, because the latter is using tree walk directly. If one object does not exist in the first disk for example, it will be seemed like the object does not exist at all and no healing work is needed. This commit fixes the behavior.
This commit is contained in:
parent
8d98662633
commit
5b9342d35c
@ -34,14 +34,10 @@ func listDirFactory(ctx context.Context, disks ...StorageAPI) ListDirFunc {
|
||||
var newEntries []string
|
||||
var err error
|
||||
entries, err = disk.ListDir(bucket, prefixDir, -1, xlMetaJSONFile)
|
||||
if err != nil {
|
||||
if err != nil || len(entries) == 0 {
|
||||
continue
|
||||
}
|
||||
|
||||
if len(entries) == 0 {
|
||||
return true, nil
|
||||
}
|
||||
|
||||
// Find elements in entries which are not in mergedEntries
|
||||
for _, entry := range entries {
|
||||
idx := sort.SearchStrings(mergedEntries, entry)
|
||||
@ -58,6 +54,11 @@ func listDirFactory(ctx context.Context, disks ...StorageAPI) ListDirFunc {
|
||||
sort.Strings(mergedEntries)
|
||||
}
|
||||
}
|
||||
|
||||
if len(mergedEntries) == 0 {
|
||||
return true, nil
|
||||
}
|
||||
|
||||
return false, filterMatchingPrefix(mergedEntries, prefixEntry)
|
||||
}
|
||||
return listDir
|
||||
|
Loading…
Reference in New Issue
Block a user