xl: Avoid multi-disks node to exit when one disk fails (#12423)

It makes sense that a node that has multiple disks starts when one
disk fails, returning an i/o error for example. This commit will make this
faulty tolerance available in this specific use case.
This commit is contained in:
Anis Elleuch
2021-06-05 17:10:32 +01:00
committed by GitHub
parent e448dbbabf
commit 810af07529
5 changed files with 62 additions and 102 deletions

View File

@@ -257,18 +257,17 @@ func (l EndpointServerPools) Localhost() string {
return ""
}
// FirstLocalDiskPath returns the disk path of first (in cmdline args order)
// local endpoint.
func (l EndpointServerPools) FirstLocalDiskPath() string {
var diskPath string
// LocalDisksPaths returns the disk paths of the local disks
func (l EndpointServerPools) LocalDisksPaths() []string {
var disks []string
for _, ep := range l {
for _, endpoint := range ep.Endpoints {
if endpoint.IsLocal {
return endpoint.Path
disks = append(disks, endpoint.Path)
}
}
}
return diskPath
return disks
}
// FirstLocal returns true if the first endpoint is local.