convert multipart-cleanup from a blocking unlink() to a rename to trash (#19495)

unlinking() at two different locations on a disk when there
are lots to purge, this can lead to huge IOwaits, instead
rely on rename() to .trash to avoid running multiple unlinks()
in parallel.
This commit is contained in:
Harshavardhana
2024-04-15 03:02:39 -07:00
committed by GitHub
parent 1c70e9ed1b
commit cb06aee5ac
3 changed files with 45 additions and 33 deletions

View File

@@ -453,8 +453,11 @@ var (
globalConnReadDeadline time.Duration
globalConnWriteDeadline time.Duration
// Controller for deleted file sweeper.
deletedCleanupSleeper = newDynamicSleeper(5, 25*time.Millisecond, false)
// dynamic sleeper to avoid thundering herd for trash folder expunge routine
deleteCleanupSleeper = newDynamicSleeper(5, 25*time.Millisecond, false)
// dynamic sleeper for multipart expiration routine
deleteMultipartCleanupSleeper = newDynamicSleeper(5, 25*time.Millisecond, false)
// Is _MINIO_DISABLE_API_FREEZE_ON_BOOT set?
globalDisableFreezeOnBoot bool