Fix heal bucket deadlock after replacing disks (#5661)

Fixes #5659
This commit is contained in:
Harshavardhana
2018-03-16 15:09:31 -07:00
committed by kannappanr
parent 3145462ad2
commit f23944aed7
5 changed files with 49 additions and 30 deletions

View File

@@ -1043,6 +1043,12 @@ func (s *xlSets) HealFormat(ctx context.Context, dryRun bool) (madmin.HealResult
// HealBucket - heals inconsistent buckets and bucket metadata on all sets.
func (s *xlSets) HealBucket(ctx context.Context, bucket string, dryRun bool) (results []madmin.HealResultItem, err error) {
bucketLock := globalNSMutex.NewNSLock(bucket, "")
if err := bucketLock.GetLock(globalHealingTimeout); err != nil {
return nil, err
}
defer bucketLock.Unlock()
// Initialize heal result info
res := madmin.HealResultItem{
Type: madmin.HealItemBucket,