mirror of
https://github.com/pgsty/minio.git
synced 2026-07-20 12:40:24 +03:00
Do not require restart when a disk is unreachable during node boot (#18576)
A disk that is not able to initialize when an instance is started will never have a handler registered, which means a user will need to restart the node after fixing the disk; This will also prevent showing the wrong 'upgrade is needed.' error message in that case. When the disk is still failing, print an error every 30 minutes; Disk reconnection will be retried every 30 seconds. Co-authored-by: Anis Elleuch <anis@min.io>
This commit is contained in:
@@ -20,9 +20,12 @@ package cmd
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"errors"
|
||||
"math/rand"
|
||||
"reflect"
|
||||
"runtime"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/minio/minio/internal/grid"
|
||||
xnet "github.com/minio/pkg/v2/net"
|
||||
@@ -480,6 +483,14 @@ func newStorageRESTHTTPServerClient(t testing.TB) *storageRESTClient {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
for {
|
||||
_, err := restClient.DiskInfo(context.Background(), false)
|
||||
if err == nil || errors.Is(err, errUnformattedDisk) {
|
||||
break
|
||||
}
|
||||
time.Sleep(time.Duration(rand.Float64() * float64(100*time.Millisecond)))
|
||||
}
|
||||
|
||||
return restClient
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user