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

@@ -300,7 +300,15 @@ func newXLStorage(ep Endpoint) (*xlStorage, error) {
return p, err
}
w.Close()
defer Remove(filePath)
Remove(filePath)
if err := formatErasureMigrate(p.diskPath); err != nil && !errors.Is(err, os.ErrNotExist) {
return p, err
}
if err := formatErasureCleanupTmp(p.diskPath); err != nil {
return p, err
}
// Success.
return p, nil