mirror of
https://github.com/minio/minio.git
synced 2025-07-25 08:20:09 -04:00
DiskInfo() must return errDiskNotFound not internal errors (#18514)
This commit is contained in:
parent
fbc6f3f6e8
commit
9032f49f25
@ -31,7 +31,6 @@ import (
|
|||||||
"github.com/minio/minio/internal/color"
|
"github.com/minio/minio/internal/color"
|
||||||
"github.com/minio/minio/internal/config"
|
"github.com/minio/minio/internal/config"
|
||||||
"github.com/minio/minio/internal/config/storageclass"
|
"github.com/minio/minio/internal/config/storageclass"
|
||||||
"github.com/minio/minio/internal/grid"
|
|
||||||
xioutil "github.com/minio/minio/internal/ioutil"
|
xioutil "github.com/minio/minio/internal/ioutil"
|
||||||
"github.com/minio/minio/internal/logger"
|
"github.com/minio/minio/internal/logger"
|
||||||
"github.com/minio/pkg/v2/sync/errgroup"
|
"github.com/minio/pkg/v2/sync/errgroup"
|
||||||
@ -391,7 +390,7 @@ func saveFormatErasure(disk StorageAPI, format *formatErasureV3, healID string)
|
|||||||
func loadFormatErasure(disk StorageAPI) (format *formatErasureV3, err error) {
|
func loadFormatErasure(disk StorageAPI) (format *formatErasureV3, err error) {
|
||||||
// Ensure that the grid is online.
|
// Ensure that the grid is online.
|
||||||
if _, err := disk.DiskInfo(context.Background(), false); err != nil {
|
if _, err := disk.DiskInfo(context.Background(), false); err != nil {
|
||||||
if errors.Is(err, grid.ErrDisconnected) {
|
if errors.Is(err, errDiskNotFound) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,6 @@ import (
|
|||||||
|
|
||||||
"github.com/minio/minio/internal/dsync"
|
"github.com/minio/minio/internal/dsync"
|
||||||
"github.com/minio/minio/internal/grid"
|
"github.com/minio/minio/internal/grid"
|
||||||
"github.com/minio/minio/internal/logger"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// lockRESTClient is authenticable lock REST client
|
// lockRESTClient is authenticable lock REST client
|
||||||
@ -54,7 +53,6 @@ func (c *lockRESTClient) String() string {
|
|||||||
func (c *lockRESTClient) call(ctx context.Context, h *grid.SingleHandler[*dsync.LockArgs, *dsync.LockResp], args *dsync.LockArgs) (ok bool, err error) {
|
func (c *lockRESTClient) call(ctx context.Context, h *grid.SingleHandler[*dsync.LockArgs, *dsync.LockResp], args *dsync.LockArgs) (ok bool, err error) {
|
||||||
r, err := h.Call(ctx, c.connection, args)
|
r, err := h.Call(ctx, c.connection, args)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.LogIfNot(ctx, err, grid.ErrDisconnected)
|
|
||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
defer h.PutResponse(r)
|
defer h.PutResponse(r)
|
||||||
|
@ -270,7 +270,7 @@ func (client *storageRESTClient) DiskInfo(ctx context.Context, metrics bool) (in
|
|||||||
// were attempted. This can lead to false success under certain conditions
|
// were attempted. This can lead to false success under certain conditions
|
||||||
// - this change attempts to avoid stale information if the underlying
|
// - this change attempts to avoid stale information if the underlying
|
||||||
// transport is already down.
|
// transport is already down.
|
||||||
return info, grid.ErrDisconnected
|
return info, errDiskNotFound
|
||||||
}
|
}
|
||||||
fetchDI := func(di *timedValue, metrics bool) {
|
fetchDI := func(di *timedValue, metrics bool) {
|
||||||
di.TTL = time.Second
|
di.TTL = time.Second
|
||||||
|
Loading…
x
Reference in New Issue
Block a user