Skip to content

Commit

Permalink
heal: Fix heal buckets result reporting (minio#9397)
Browse files Browse the repository at this point in the history
healBucket() was not properly collecting results after healing
buckets. This commit adds After drives information correctly.
  • Loading branch information
vadmeste authored Apr 20, 2020
1 parent 3ff5bf2 commit 2eeb0e6
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions cmd/xl-v1-healing.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,6 @@ func healBucket(ctx context.Context, storageDisks []StorageAPI, bucket string, w
Endpoint: drive,
State: beforeState[i],
})
res.After.Drives = append(res.After.Drives, madmin.HealDriveInfo{
UUID: "",
Endpoint: drive,
State: afterState[i],
})
}
}

Expand All @@ -151,12 +146,26 @@ func healBucket(ctx context.Context, storageDisks []StorageAPI, bucket string, w
errs = g.Wait()

reducedErr = reduceWriteQuorumErrs(ctx, errs, bucketOpIgnoredErrs, writeQuorum)
if reducedErr == errXLWriteQuorum {
// Purge successfully created buckets if we don't have writeQuorum.
undoMakeBucket(storageDisks, bucket)
if reducedErr != nil {
if reducedErr == errXLWriteQuorum {
// Purge successfully created buckets if we don't have writeQuorum.
undoMakeBucket(storageDisks, bucket)
}
return res, reducedErr
}

for i := range afterState {
if storageDisks[i] != nil {
drive := storageDisks[i].String()
res.After.Drives = append(res.After.Drives, madmin.HealDriveInfo{
UUID: "",
Endpoint: drive,
State: afterState[i],
})
}
}

return res, reducedErr
return res, nil
}

// listAllBuckets lists all buckets from all disks. It also
Expand Down

0 comments on commit 2eeb0e6

Please sign in to comment.