mirror of
https://github.com/minio/minio.git
synced 2025-01-25 21:53:16 -05:00
add unformatted disk as part of the error list (#10128)
these errors should be ignored for quorum error calculation to ensure that we don't prematurely return unformatted disk error as part of API calls
This commit is contained in:
parent
57ff9abca2
commit
35212b673e
@ -26,7 +26,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// list all errors that can be ignore in a bucket operation.
|
// list all errors that can be ignore in a bucket operation.
|
||||||
var bucketOpIgnoredErrs = append(baseIgnoredErrs, errDiskAccessDenied)
|
var bucketOpIgnoredErrs = append(baseIgnoredErrs, errDiskAccessDenied, errUnformattedDisk)
|
||||||
|
|
||||||
// list all errors that can be ignored in a bucket metadata operation.
|
// list all errors that can be ignored in a bucket metadata operation.
|
||||||
var bucketMetadataOpIgnoredErrs = append(bucketOpIgnoredErrs, errVolumeNotFound)
|
var bucketMetadataOpIgnoredErrs = append(bucketOpIgnoredErrs, errVolumeNotFound)
|
||||||
|
@ -33,7 +33,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// list all errors which can be ignored in object operations.
|
// list all errors which can be ignored in object operations.
|
||||||
var objectOpIgnoredErrs = append(baseIgnoredErrs, errDiskAccessDenied)
|
var objectOpIgnoredErrs = append(baseIgnoredErrs, errDiskAccessDenied, errUnformattedDisk)
|
||||||
|
|
||||||
// putObjectDir hints the bottom layer to create a new directory.
|
// putObjectDir hints the bottom layer to create a new directory.
|
||||||
func (er erasureObjects) putObjectDir(ctx context.Context, bucket, object string, writeQuorum int) error {
|
func (er erasureObjects) putObjectDir(ctx context.Context, bucket, object string, writeQuorum int) error {
|
||||||
|
@ -100,7 +100,9 @@ func cleanupDir(ctx context.Context, storage StorageAPI, volume, dirPath string)
|
|||||||
if !HasSuffix(entryPath, SlashSeparator) {
|
if !HasSuffix(entryPath, SlashSeparator) {
|
||||||
// Delete the file entry.
|
// Delete the file entry.
|
||||||
err := storage.DeleteFile(volume, entryPath)
|
err := storage.DeleteFile(volume, entryPath)
|
||||||
logger.LogIf(ctx, err)
|
if err != errDiskNotFound && err != errUnformattedDisk {
|
||||||
|
logger.LogIf(ctx, err)
|
||||||
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -110,14 +112,18 @@ func cleanupDir(ctx context.Context, storage StorageAPI, volume, dirPath string)
|
|||||||
if err == errFileNotFound {
|
if err == errFileNotFound {
|
||||||
return nil
|
return nil
|
||||||
} else if err != nil { // For any other errors fail.
|
} else if err != nil { // For any other errors fail.
|
||||||
logger.LogIf(ctx, err)
|
if err != errDiskNotFound && err != errUnformattedDisk {
|
||||||
|
logger.LogIf(ctx, err)
|
||||||
|
}
|
||||||
return err
|
return err
|
||||||
} // else on success..
|
} // else on success..
|
||||||
|
|
||||||
// Entry path is empty, just delete it.
|
// Entry path is empty, just delete it.
|
||||||
if len(entries) == 0 {
|
if len(entries) == 0 {
|
||||||
err = storage.DeleteFile(volume, entryPath)
|
err = storage.DeleteFile(volume, entryPath)
|
||||||
logger.LogIf(ctx, err)
|
if err != errDiskNotFound && err != errUnformattedDisk {
|
||||||
|
logger.LogIf(ctx, err)
|
||||||
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -715,6 +715,7 @@ next:
|
|||||||
|
|
||||||
_, err = deleteObject(ctx, objectAPI, web.CacheAPI(), args.BucketName, objectName, r, opts)
|
_, err = deleteObject(ctx, objectAPI, web.CacheAPI(), args.BucketName, objectName, r, opts)
|
||||||
logger.LogIf(ctx, err)
|
logger.LogIf(ctx, err)
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if authErr == errNoAuthToken {
|
if authErr == errNoAuthToken {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user