Imporve healing and reporting (#11312)

* Provide information on *actively* healing, buckets healed/queued, objects healed/failed.
* Add concurrent healing of multiple sets (typically on startup).
* Add bucket level resume, so restarts will only heal non-healed buckets.
* Print summary after healing a disk is done.
This commit is contained in:
Klaus Post
2021-03-04 14:36:23 -08:00
committed by GitHub
parent 97e7a902d0
commit fa9cf1251b
36 changed files with 1357 additions and 307 deletions

View File

@@ -18,6 +18,9 @@ package cmd
import (
"context"
"encoding/hex"
"fmt"
"math/rand"
"reflect"
"testing"
)
@@ -199,3 +202,22 @@ func TestEvalDisks(t *testing.T) {
z := objLayer.(*erasureServerPools)
testShuffleDisks(t, z)
}
func Test_hashOrder(t *testing.T) {
for x := 1; x < 17; x++ {
t.Run(fmt.Sprintf("%d", x), func(t *testing.T) {
var first [17]int
rng := rand.New(rand.NewSource(0))
var tmp [16]byte
rng.Read(tmp[:])
prefix := hex.EncodeToString(tmp[:])
for i := 0; i < 10000; i++ {
rng.Read(tmp[:])
y := hashOrder(fmt.Sprintf("%s/%x", prefix, hex.EncodeToString(tmp[:3])), x)
first[y[0]]++
}
t.Log("first:", first[:x])
})
}
}