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
master
Harshavardhana 4 years ago committed by GitHub
parent 57ff9abca2
commit 35212b673e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      cmd/erasure-bucket.go
  2. 2
      cmd/erasure-object.go
  3. 12
      cmd/object-api-common.go
  4. 1
      cmd/web-handlers.go

@ -26,7 +26,7 @@ import (
)
// 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.
var bucketMetadataOpIgnoredErrs = append(bucketOpIgnoredErrs, errVolumeNotFound)

@ -33,7 +33,7 @@ import (
)
// 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.
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) {
// Delete the file entry.
err := storage.DeleteFile(volume, entryPath)
logger.LogIf(ctx, err)
if err != errDiskNotFound && err != errUnformattedDisk {
logger.LogIf(ctx, err)
}
return err
}
@ -110,14 +112,18 @@ func cleanupDir(ctx context.Context, storage StorageAPI, volume, dirPath string)
if err == errFileNotFound {
return nil
} else if err != nil { // For any other errors fail.
logger.LogIf(ctx, err)
if err != errDiskNotFound && err != errUnformattedDisk {
logger.LogIf(ctx, err)
}
return err
} // else on success..
// Entry path is empty, just delete it.
if len(entries) == 0 {
err = storage.DeleteFile(volume, entryPath)
logger.LogIf(ctx, err)
if err != errDiskNotFound && err != errUnformattedDisk {
logger.LogIf(ctx, err)
}
return err
}

@ -715,6 +715,7 @@ next:
_, err = deleteObject(ctx, objectAPI, web.CacheAPI(), args.BucketName, objectName, r, opts)
logger.LogIf(ctx, err)
continue
}
if authErr == errNoAuthToken {

Loading…
Cancel
Save