You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
minio/pkg/donut/heal.go

34 lines
652 B

package donut
import "github.com/minio/minio/pkg/iodine"
type missingDisk struct {
nodeNumber int
sliceNumber int
bucketName string
}
// Heal heal an existing donut
func (donut API) Heal() error {
var missingDisks []missingDisk
nodeNumber := 0
for _, node := range donut.nodes {
disks, err := node.ListDisks()
if err != nil {
return iodine.New(err, nil)
}
for i, disk := range disks {
_, err := disk.ListDir(donut.config.DonutName)
if err == nil {
continue
}
missingDisk := missingDisk{
nodeNumber: nodeNumber,
sliceNumber: i,
}
missingDisks = append(missingDisks, missingDisk)
}
}
return nil
}