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:
Klaus Post
2023-12-01 12:01:14 -08:00
committed by GitHub
parent 860fc200b0
commit 961b0b524e
3 changed files with 109 additions and 84 deletions
+11
View File
@@ -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
}