fix: handle weird drives sporadic read O_DIRECT behavior (#11832)

on freshReads if drive returns errInvalidArgument, we
should simply turn-off DirectIO and read normally, there
are situations in k8s like environments where the drives
behave sporadically in a single deployment and may not
have been implemented properly to handle O_DIRECT for
reads.
This commit is contained in:
Harshavardhana
2021-03-18 20:16:50 -07:00
committed by GitHub
parent be5910b87e
commit b92a220db1
3 changed files with 26 additions and 33 deletions

View File

@@ -19,6 +19,7 @@ package cmd
import (
"context"
"errors"
"fmt"
"hash/crc32"
"github.com/minio/minio/cmd/logger"
@@ -134,7 +135,8 @@ func readAllFileInfo(ctx context.Context, disks []StorageAPI, bucket, object, ve
errFileVersionNotFound,
errDiskNotFound,
}...) {
logger.LogOnceIf(ctx, err, disks[index].String())
logger.LogOnceIf(ctx, fmt.Errorf("Drive %s returned an error (%w)", disks[index], err),
disks[index].String())
}
}
return err