avoid Access() calls on known bucket paths (#17719)

This commit is contained in:
Harshavardhana
2023-07-26 11:31:40 -07:00
committed by GitHub
parent a7c71e4c6b
commit b28bcad11b
3 changed files with 85 additions and 70 deletions

View File

@@ -23,6 +23,7 @@ import (
"fmt"
"net/http"
"net/url"
"path/filepath"
"sync"
"time"
@@ -97,6 +98,12 @@ func bgFormatErasureCleanupTmp(diskPath string) {
err))
}
// Delete all temporary files created for DirectIO write check
files, _ := filepath.Glob(filepath.Join(diskPath, ".writable-check-*.tmp"))
for _, file := range files {
removeAll(file)
}
// Remove the entire folder in case there are leftovers that didn't get cleaned up before restart.
go removeAll(pathJoin(diskPath, minioMetaTmpBucket+"-old"))
// Renames and schedules for purging all bucket metacache.