Handle removal of disks - getObject() now reads if disks are missing underneath, add initial stub healing code

This commit is contained in:
Harshavardhana
2015-07-14 18:50:29 -07:00
parent 74853caf0c
commit e885259584
4 changed files with 62 additions and 36 deletions

26
pkg/donut/heal.go Normal file
View 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
}