|
|
@ -117,26 +117,24 @@ 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 occurred
|
|
|
|
// A non nil err means that an unexpected error occured
|
|
|
|
return err |
|
|
|
return toObjectErr(traceError(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 occurred
|
|
|
|
// A non nil err means that an unexpected error occured
|
|
|
|
return err |
|
|
|
return toObjectErr(traceError(err)) |
|
|
|
} |
|
|
|
} |
|
|
|
// Cleanup everything else.
|
|
|
|
// Cleanup everything else.
|
|
|
|
prefix := "" |
|
|
|
prefix := "" |
|
|
|
if err = cleanupDir(fs.storage, minioMetaBucket, prefix); err != nil { |
|
|
|
if err = cleanupDir(fs.storage, minioMetaBucket, prefix); err != nil { |
|
|
|
errorIf(err, "Unable to cleanup minio meta bucket") |
|
|
|
|
|
|
|
return err |
|
|
|
return err |
|
|
|
} |
|
|
|
} |
|
|
|
if err = fs.storage.DeleteVol(minioMetaBucket); err != nil { |
|
|
|
if err = fs.storage.DeleteVol(minioMetaBucket); err != nil { |
|
|
|
if err != errVolumeNotEmpty { |
|
|
|
if err != errVolumeNotEmpty { |
|
|
|
errorIf(err, "Unable to delete minio meta bucket %s", minioMetaBucket) |
|
|
|
return toObjectErr(traceError(err)) |
|
|
|
return err |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// Successful.
|
|
|
|
// Successful.
|
|
|
@ -220,7 +218,7 @@ func (fs fsObjects) DeleteBucket(bucket string) error { |
|
|
|
return toObjectErr(traceError(err), bucket) |
|
|
|
return toObjectErr(traceError(err), bucket) |
|
|
|
} |
|
|
|
} |
|
|
|
// Cleanup all the previously incomplete multiparts.
|
|
|
|
// Cleanup all the previously incomplete multiparts.
|
|
|
|
if err := cleanupDir(fs.storage, path.Join(minioMetaBucket, mpartMetaPrefix), bucket); err != nil && err != errVolumeNotFound { |
|
|
|
if err := cleanupDir(fs.storage, path.Join(minioMetaBucket, mpartMetaPrefix), bucket); err != nil && errorCause(err) != errVolumeNotFound { |
|
|
|
return toObjectErr(err, bucket) |
|
|
|
return toObjectErr(err, bucket) |
|
|
|
} |
|
|
|
} |
|
|
|
return nil |
|
|
|
return nil |
|
|
|