mirror of
https://github.com/minio/minio.git
synced 2025-11-06 20:33:07 -05:00
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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user