mirror of
https://github.com/minio/minio.git
synced 2025-12-02 22:20:43 -05:00
Handle removal of disks - getObject() now reads if disks are missing underneath, add initial stub healing code
This commit is contained in:
26
pkg/donut/heal.go
Normal file
26
pkg/donut/heal.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package donut
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/minio/minio/pkg/iodine"
|
||||
)
|
||||
|
||||
// Heal heal an existing donut
|
||||
func (donut API) Heal() error {
|
||||
missingDisks := make(map[int]struct{})
|
||||
for _, node := range donut.nodes {
|
||||
disks, err := node.ListDisks()
|
||||
if err != nil {
|
||||
return iodine.New(err, nil)
|
||||
}
|
||||
for i, disk := range disks {
|
||||
dirs, err := disk.ListDir(donut.config.DonutName)
|
||||
if err != nil {
|
||||
missingDisks[i] = struct{}{}
|
||||
}
|
||||
fmt.Println(dirs)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user