heal: Refactor heal command. (#2901)

- return errors for heal operation through rpc replies.
  - implement rotating wheel for healing status.

Fixes #2491
This commit is contained in:
Harshavardhana
2016-10-14 19:57:40 -07:00
committed by GitHub
parent 18be3bc95a
commit f22862aa28
20 changed files with 619 additions and 244 deletions

View File

@@ -305,27 +305,3 @@ func (xl xlObjects) DeleteBucket(bucket string) error {
// Success.
return nil
}
// Heal bucket - create buckets on disks where it does not exist.
func healBucket(disks []StorageAPI, bucket string) error {
bucketFound := false
for _, disk := range disks {
_, err := disk.StatVol(bucket)
if err == nil {
bucketFound = true
}
}
if !bucketFound {
return traceError(errVolumeNotFound)
}
for _, disk := range disks {
err := disk.MakeVol(bucket)
if err == nil {
continue
}
if err != errVolumeExists {
return traceError(err)
}
}
return nil
}