mirror of
https://github.com/minio/minio.git
synced 2025-11-09 21:49:46 -05:00
XL and FS use different tree walk ignored errors (#2707)
This commit is contained in:
committed by
Harshavardhana
parent
a1ff351f21
commit
7a549096de
@@ -21,15 +21,6 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
// list of all errors that can be ignored in tree walk operation.
|
||||
var walkResultIgnoredErrs = []error{
|
||||
errFileNotFound,
|
||||
errVolumeNotFound,
|
||||
errDiskNotFound,
|
||||
errDiskAccessDenied,
|
||||
errFaultyDisk,
|
||||
}
|
||||
|
||||
// Tree walk result carries results of tree walking.
|
||||
type treeWalkResult struct {
|
||||
entry string
|
||||
@@ -107,7 +98,7 @@ type isLeafFunc func(string, string) bool
|
||||
// Returns function "listDir" of the type listDirFunc.
|
||||
// isLeaf - is used by listDir function to check if an entry is a leaf or non-leaf entry.
|
||||
// disks - used for doing disk.ListDir(). FS passes single disk argument, XL passes a list of disks.
|
||||
func listDirFactory(isLeaf isLeafFunc, disks ...StorageAPI) listDirFunc {
|
||||
func listDirFactory(isLeaf isLeafFunc, treeWalkIgnoredErrs []error, disks ...StorageAPI) listDirFunc {
|
||||
// listDir - lists all the entries at a given prefix and given entry in the prefix.
|
||||
listDir := func(bucket, prefixDir, prefixEntry string) (entries []string, delayIsLeaf bool, err error) {
|
||||
for _, disk := range disks {
|
||||
@@ -142,7 +133,7 @@ func listDirFactory(isLeaf isLeafFunc, disks ...StorageAPI) listDirFunc {
|
||||
}
|
||||
// For any reason disk was deleted or goes offline, continue
|
||||
// and list from other disks if possible.
|
||||
if isErrIgnored(err, walkResultIgnoredErrs) {
|
||||
if isErrIgnored(err, treeWalkIgnoredErrs) {
|
||||
continue
|
||||
}
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user