diff --git a/cmd/admin-handlers.go b/cmd/admin-handlers.go index f1c1d93db..e425ef492 100644 --- a/cmd/admin-handlers.go +++ b/cmd/admin-handlers.go @@ -753,26 +753,23 @@ func (a adminAPIHandlers) HealSetsHandler(w http.ResponseWriter, r *http.Request opts.setNumbers = append(opts.setNumbers, i-1) } + opts.sleepDuration = time.Second var err error - if v := vars[healSleepDuration]; v != "" { opts.sleepDuration, err = time.ParseDuration(v) if err != nil { writeErrorResponseJSON(ctx, w, toAdminAPIErr(ctx, err), r.URL) return } - } else { - opts.sleepDuration = 100 * time.Millisecond } + opts.sleepForIO = 10 if v := vars[healSleepMaxIO]; v != "" { opts.sleepForIO, err = strconv.Atoi(v) if err != nil { writeErrorResponseJSON(ctx, w, toAdminAPIErr(ctx, err), r.URL) return } - } else { - opts.sleepForIO = 1000 } buckets, _ := objectAPI.ListBucketsHeal(ctx) diff --git a/cmd/admin-heal-ops.go b/cmd/admin-heal-ops.go index 85e145795..604e2f0aa 100644 --- a/cmd/admin-heal-ops.go +++ b/cmd/admin-heal-ops.go @@ -21,6 +21,7 @@ import ( "encoding/json" "fmt" "net/http" + "runtime" "sync" "time" @@ -420,7 +421,7 @@ func newHealSequence(ctx context.Context, bucket, objPrefix, clientAddr string, clientToken := mustGetUUID() return &healSequence{ - respCh: make(chan healResult), + respCh: make(chan healResult, runtime.GOMAXPROCS(0)), bucket: bucket, object: objPrefix, reportProgress: true, diff --git a/cmd/background-heal-ops.go b/cmd/background-heal-ops.go index 24b86e307..4505bead5 100644 --- a/cmd/background-heal-ops.go +++ b/cmd/background-heal-ops.go @@ -19,6 +19,7 @@ package cmd import ( "context" "path" + "runtime" "time" "github.com/minio/minio/pkg/madmin" @@ -125,7 +126,7 @@ func (h *healRoutine) run(ctx context.Context, objAPI ObjectLayer) { func newHealRoutine() *healRoutine { return &healRoutine{ - tasks: make(chan healTask), + tasks: make(chan healTask, runtime.GOMAXPROCS(0)), doneCh: make(chan struct{}), } diff --git a/cmd/global-heal.go b/cmd/global-heal.go index 21bf829ce..b3e3afc5c 100644 --- a/cmd/global-heal.go +++ b/cmd/global-heal.go @@ -18,6 +18,7 @@ package cmd import ( "context" + "runtime" "sync" "time" @@ -42,8 +43,8 @@ func newBgHealSequence() *healSequence { } return &healSequence{ - sourceCh: make(chan healSource), - respCh: make(chan healResult), + sourceCh: make(chan healSource, runtime.GOMAXPROCS(0)), + respCh: make(chan healResult, runtime.GOMAXPROCS(0)), startTime: UTCNow(), clientToken: bgHealingUUID, // run-background heal with reserved bucket @@ -180,6 +181,8 @@ func healErasureSet(ctx context.Context, prefix string, setIndex int, maxIO int, for { entry, quorumCount, ok := lexicallySortedEntryVersions(entryChs, entries, entriesValid) if !ok { + logger.Info("Healing finished for bucket '%s' on erasure set %d", setIndex+1) + // We are finished with this bucket return. return }