fix: handle setIndexes properly

This commit is contained in:
Harshavardhana 2021-02-08 22:22:26 -08:00
parent bc89e47066
commit f07c9c58e7
3 changed files with 12 additions and 11 deletions

View File

@ -785,9 +785,7 @@ func (a adminAPIHandlers) HealSetsHandler(w http.ResponseWriter, r *http.Request
defer wg.Done()
lbDisks := z.serverSets[0].sets[setNumber].getDisks()
if err := healErasureSet(ctx, vars[healSetsPrefix], setNumber, opts.sleepForIO, opts.sleepDuration, buckets, lbDisks); err != nil {
if !isErrBucketNotFound(err) {
logger.LogIf(ctx, err)
}
logger.LogIf(ctx, err)
}
}(setNumber)
}

View File

@ -909,12 +909,12 @@ func lexicallySortedEntryVersions(entryChs []FileInfoVersionsCh, entries []FileI
if !found {
lentry = entries[i]
found = true
setIndex = i
setIndex = entryChs[i].SetIndex
continue
}
if entries[i].Name < lentry.Name {
lentry = entries[i]
setIndex = i
setIndex = entryChs[i].SetIndex
}
}

View File

@ -127,11 +127,14 @@ func healErasureSet(ctx context.Context, prefix string, setIndex int, maxIO int,
object: backendEncryptedFile,
}
buckets = append(buckets, BucketInfo{
Name: pathJoin(minioMetaBucket, minioConfigPrefix),
}, BucketInfo{
Name: pathJoin(minioMetaBucket, bucketConfigPrefix),
}) // add metadata .minio.sys/ bucket prefixes to heal
// Heal config prefix.
bgSeq.sourceCh <- healSource{
bucket: pathJoin(minioMetaBucket, minioConfigPrefix),
}
bgSeq.sourceCh <- healSource{
bucket: pathJoin(minioMetaBucket, bucketConfigPrefix),
}
// Heal all buckets with all objects
var wg sync.WaitGroup
@ -177,7 +180,7 @@ func healErasureSet(ctx context.Context, prefix string, setIndex int, maxIO int,
for {
entry, quorumCount, ok := lexicallySortedEntryVersions(entryChs, entries, entriesValid)
if !ok {
break
return
}
if quorumCount == setDriveCount {