mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05:00
fix: rename(tmp, tmp-old) is necessary
previous PR incorrectly changed rename() from tmp to -> tmp/.trash/uuid, since it is self referential - to clear this up make sure its renamed to a separate folder and deleted in background - just like before.
This commit is contained in:
parent
4669d19f2a
commit
180eabaa8e
@ -72,16 +72,16 @@ var printEndpointError = func() func(Endpoint, error, bool) {
|
||||
// Cleans up tmp directory of the local disk.
|
||||
func formatErasureCleanupTmp(diskPath string) error {
|
||||
// Need to move temporary objects left behind from previous run of minio
|
||||
// server to a unique directory under `minioMetaTmpBucket/.trash` to clean
|
||||
// server to a unique directory under `minioMetaTmpBucket-old` to clean
|
||||
// up `minioMetaTmpBucket` for the current run.
|
||||
//
|
||||
// /disk1/.minio.sys/tmp/.trash/uuid
|
||||
// /disk1/.minio.sys/tmp-old/
|
||||
// |__ 33a58b40-aecc-4c9f-a22f-ff17bfa33b62
|
||||
// |__ e870a2c1-d09c-450c-a69c-6eaa54a89b3e
|
||||
//
|
||||
// In this example, `33a58b40-aecc-4c9f-a22f-ff17bfa33b62` directory contains
|
||||
// temporary objects from one of the previous runs of minio server.
|
||||
tmpOld := pathJoin(diskPath, minioMetaTmpDeletedBucket, mustGetUUID())
|
||||
tmpOld := pathJoin(diskPath, minioMetaTmpBucket+"-old", mustGetUUID())
|
||||
if err := renameAll(pathJoin(diskPath, minioMetaTmpBucket),
|
||||
tmpOld); err != nil && err != errFileNotFound {
|
||||
logger.LogIf(GlobalContext, fmt.Errorf("unable to rename (%s -> %s) %w, drive may be faulty please investigate",
|
||||
@ -94,9 +94,9 @@ func formatErasureCleanupTmp(diskPath string) error {
|
||||
renameAllBucketMetacache(diskPath)
|
||||
|
||||
// Removal of tmp-old folder is backgrounded completely.
|
||||
go removeAll(tmpOld)
|
||||
go removeAll(pathJoin(diskPath, minioMetaTmpBucket+"-old"))
|
||||
|
||||
if err := mkdirAll(pathJoin(diskPath, minioMetaTmpBucket), 0777); err != nil {
|
||||
if err := mkdirAll(pathJoin(diskPath, minioMetaTmpDeletedBucket), 0777); err != nil {
|
||||
logger.LogIf(GlobalContext, fmt.Errorf("unable to create (%s) %w, drive may be faulty please investigate",
|
||||
pathJoin(diskPath, minioMetaTmpBucket),
|
||||
err))
|
||||
|
Loading…
Reference in New Issue
Block a user