mirror of
https://github.com/minio/minio.git
synced 2024-12-24 22:25:54 -05:00
server: Remove deadcode. (#2699)
This commit is contained in:
parent
6533927237
commit
1e6d67b16d
@ -629,19 +629,19 @@ func TestReduceFormatErrs(t *testing.T) {
|
|||||||
}
|
}
|
||||||
// One corrupted format
|
// One corrupted format
|
||||||
if err := reduceFormatErrs([]error{nil, nil, errCorruptedFormat, nil}, 4); err != errCorruptedFormat {
|
if err := reduceFormatErrs([]error{nil, nil, errCorruptedFormat, nil}, 4); err != errCorruptedFormat {
|
||||||
t.Fatal("Got a differnt error: ", err)
|
t.Fatal("Got a different error: ", err)
|
||||||
}
|
}
|
||||||
// All disks unformatted
|
// All disks unformatted
|
||||||
if err := reduceFormatErrs([]error{errUnformattedDisk, errUnformattedDisk, errUnformattedDisk, errUnformattedDisk}, 4); err != errUnformattedDisk {
|
if err := reduceFormatErrs([]error{errUnformattedDisk, errUnformattedDisk, errUnformattedDisk, errUnformattedDisk}, 4); err != errUnformattedDisk {
|
||||||
t.Fatal("Got a differnt error: ", err)
|
t.Fatal("Got a different error: ", err)
|
||||||
}
|
}
|
||||||
// Some disks unformatted
|
// Some disks unformatted
|
||||||
if err := reduceFormatErrs([]error{nil, nil, errUnformattedDisk, errUnformattedDisk}, 4); err != errSomeDiskUnformatted {
|
if err := reduceFormatErrs([]error{nil, nil, errUnformattedDisk, errUnformattedDisk}, 4); err != errSomeDiskUnformatted {
|
||||||
t.Fatal("Got a differnt error: ", err)
|
t.Fatal("Got a different error: ", err)
|
||||||
}
|
}
|
||||||
// Some disks offline
|
// Some disks offline
|
||||||
if err := reduceFormatErrs([]error{nil, nil, errDiskNotFound, errUnformattedDisk}, 4); err != errSomeDiskOffline {
|
if err := reduceFormatErrs([]error{nil, nil, errDiskNotFound, errUnformattedDisk}, 4); err != errSomeDiskOffline {
|
||||||
t.Fatal("Got a differnt error: ", err)
|
t.Fatal("Got a different error: ", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,14 +117,14 @@ func (fs fsObjects) Shutdown() error {
|
|||||||
_, err := fs.storage.ListDir(minioMetaBucket, mpartMetaPrefix)
|
_, err := fs.storage.ListDir(minioMetaBucket, mpartMetaPrefix)
|
||||||
if err != errFileNotFound {
|
if err != errFileNotFound {
|
||||||
// A nil err means that multipart directory is not empty hence do not remove '.minio.sys' volume.
|
// A nil err means that multipart directory is not empty hence do not remove '.minio.sys' volume.
|
||||||
// A non nil err means that an unexpected error occured
|
// A non nil err means that an unexpected error occurred
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
// List if there are any bucket configuration entries.
|
// List if there are any bucket configuration entries.
|
||||||
_, err = fs.storage.ListDir(minioMetaBucket, bucketConfigPrefix)
|
_, err = fs.storage.ListDir(minioMetaBucket, bucketConfigPrefix)
|
||||||
if err != errFileNotFound {
|
if err != errFileNotFound {
|
||||||
// A nil err means that bucket config directory is not empty hence do not remove '.minio.sys' volume.
|
// A nil err means that bucket config directory is not empty hence do not remove '.minio.sys' volume.
|
||||||
// A non nil err means that an unexpected error occured
|
// A non nil err means that an unexpected error occurred
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
// Cleanup everything else.
|
// Cleanup everything else.
|
||||||
|
@ -33,17 +33,6 @@ func isSysErrNotDir(err error) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the given error corresponds to EISDIR (is a directory)
|
|
||||||
func isSysErrIsDir(err error) bool {
|
|
||||||
if pathErr, ok := err.(*os.PathError); ok {
|
|
||||||
switch pathErr.Err {
|
|
||||||
case syscall.EISDIR:
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check if the given error corresponds to ENOTEMPTY for unix
|
// Check if the given error corresponds to ENOTEMPTY for unix
|
||||||
// and ERROR_DIR_NOT_EMPTY for windows (directory not empty)
|
// and ERROR_DIR_NOT_EMPTY for windows (directory not empty)
|
||||||
func isSysErrNotEmpty(err error) bool {
|
func isSysErrNotEmpty(err error) bool {
|
||||||
|
@ -27,9 +27,6 @@ var errXLMinDisks = errors.New("Minimum '4' disks are required to enable erasure
|
|||||||
// errXLNumDisks - returned for odd number of disks.
|
// errXLNumDisks - returned for odd number of disks.
|
||||||
var errXLNumDisks = errors.New("Total number of disks should be multiples of '2'")
|
var errXLNumDisks = errors.New("Total number of disks should be multiples of '2'")
|
||||||
|
|
||||||
// errXLDuplicateArguments - returned for duplicate disks.
|
|
||||||
var errXLDuplicateArguments = errors.New("Duplicate disks found.")
|
|
||||||
|
|
||||||
// errXLReadQuorum - did not meet read quorum.
|
// errXLReadQuorum - did not meet read quorum.
|
||||||
var errXLReadQuorum = errors.New("Read failed. Insufficient number of disks online")
|
var errXLReadQuorum = errors.New("Read failed. Insufficient number of disks online")
|
||||||
|
|
||||||
|
@ -119,17 +119,6 @@ func outDatedDisks(disks []StorageAPI, partsMetadata []xlMetaV1, errs []error) (
|
|||||||
return outDatedDisks
|
return outDatedDisks
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return xlMetaV1 of the latest version of the object.
|
|
||||||
func xlLatestMetadata(partsMetadata []xlMetaV1, errs []error) (latestMeta xlMetaV1) {
|
|
||||||
// List all the file commit ids from parts metadata.
|
|
||||||
modTimes := listObjectModtimes(partsMetadata, errs)
|
|
||||||
|
|
||||||
// Reduce list of UUIDs to a single common value.
|
|
||||||
modTime := commonTime(modTimes)
|
|
||||||
|
|
||||||
return pickValidXLMeta(partsMetadata, modTime)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Returns if the object should be healed.
|
// Returns if the object should be healed.
|
||||||
func xlShouldHeal(partsMetadata []xlMetaV1, errs []error) bool {
|
func xlShouldHeal(partsMetadata []xlMetaV1, errs []error) bool {
|
||||||
modTime := commonTime(listObjectModtimes(partsMetadata, errs))
|
modTime := commonTime(listObjectModtimes(partsMetadata, errs))
|
||||||
|
Loading…
Reference in New Issue
Block a user