mirror of
https://github.com/pgsty/minio.git
synced 2026-07-24 06:26:17 +03:00
heal buckets during init and make sure to wait on quorum (#9526)
heal buckets properly during expansion, and make sure to wait for the quorum properly such that healing can be retried.
This commit is contained in:
+8
-9
@@ -22,6 +22,7 @@ import (
|
||||
"hash/crc32"
|
||||
"io"
|
||||
"net/http"
|
||||
"sort"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
@@ -1689,20 +1690,18 @@ func (s *xlSets) HealObject(ctx context.Context, bucket, object string, opts mad
|
||||
|
||||
// Lists all buckets which need healing.
|
||||
func (s *xlSets) ListBucketsHeal(ctx context.Context) ([]BucketInfo, error) {
|
||||
listBuckets := []BucketInfo{}
|
||||
var healBuckets = map[string]BucketInfo{}
|
||||
var listBuckets []BucketInfo
|
||||
var healBuckets = make(map[string]VolInfo)
|
||||
for _, set := range s.sets {
|
||||
buckets, _, err := listAllBuckets(set.getDisks())
|
||||
if err != nil {
|
||||
// lists all unique buckets across drives.
|
||||
if err := listAllBuckets(set.getDisks(), healBuckets); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for _, currBucket := range buckets {
|
||||
healBuckets[currBucket.Name] = BucketInfo(currBucket)
|
||||
}
|
||||
}
|
||||
for _, bucketInfo := range healBuckets {
|
||||
listBuckets = append(listBuckets, bucketInfo)
|
||||
for _, v := range healBuckets {
|
||||
listBuckets = append(listBuckets, BucketInfo(v))
|
||||
}
|
||||
sort.Sort(byBucketName(listBuckets))
|
||||
return listBuckets, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user