mirror of
https://github.com/minio/minio.git
synced 2024-12-24 22:25:54 -05:00
Reduce temporary file clean-up waits (#16110)
This commit is contained in:
parent
08103870a5
commit
98ba622679
@ -206,7 +206,7 @@ func (er erasureObjects) cleanupStaleUploadsOnDisk(ctx context.Context, disk Sto
|
|||||||
er.deleteAll(ctx, minioMetaMultipartBucket, uploadIDPath)
|
er.deleteAll(ctx, minioMetaMultipartBucket, uploadIDPath)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
wait := er.deletedCleanupSleeper.Timer(ctx)
|
wait := deletedCleanupSleeper.Timer(ctx)
|
||||||
if now.Sub(fi.ModTime) > expiry {
|
if now.Sub(fi.ModTime) > expiry {
|
||||||
er.deleteAll(ctx, minioMetaMultipartBucket, uploadIDPath)
|
er.deleteAll(ctx, minioMetaMultipartBucket, uploadIDPath)
|
||||||
}
|
}
|
||||||
@ -223,7 +223,7 @@ func (er erasureObjects) cleanupStaleUploadsOnDisk(ctx context.Context, disk Sto
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
wait := er.deletedCleanupSleeper.Timer(ctx)
|
wait := deletedCleanupSleeper.Timer(ctx)
|
||||||
if now.Sub(vi.Created) > expiry {
|
if now.Sub(vi.Created) > expiry {
|
||||||
er.deleteAll(ctx, minioMetaTmpBucket, tmpDir)
|
er.deleteAll(ctx, minioMetaTmpBucket, tmpDir)
|
||||||
}
|
}
|
||||||
|
@ -468,7 +468,6 @@ func newErasureSets(ctx context.Context, endpoints PoolEndpoints, storageDisks [
|
|||||||
getDisks: s.GetDisks(i),
|
getDisks: s.GetDisks(i),
|
||||||
getLockers: s.GetLockers(i),
|
getLockers: s.GetLockers(i),
|
||||||
getEndpoints: s.GetEndpoints(i),
|
getEndpoints: s.GetEndpoints(i),
|
||||||
deletedCleanupSleeper: newDynamicSleeper(10, 2*time.Second, false),
|
|
||||||
nsMutex: mutex,
|
nsMutex: mutex,
|
||||||
bp: bp,
|
bp: bp,
|
||||||
bpOld: bpOld,
|
bpOld: bpOld,
|
||||||
|
@ -66,8 +66,6 @@ type erasureObjects struct {
|
|||||||
// Byte pools used for temporary i/o buffers,
|
// Byte pools used for temporary i/o buffers,
|
||||||
// legacy objects.
|
// legacy objects.
|
||||||
bpOld *bpool.BytePoolCap
|
bpOld *bpool.BytePoolCap
|
||||||
|
|
||||||
deletedCleanupSleeper *dynamicSleeper
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewNSLock - initialize a new namespace RWLocker instance.
|
// NewNSLock - initialize a new namespace RWLocker instance.
|
||||||
@ -338,7 +336,7 @@ func (er erasureObjects) cleanupDeletedObjects(ctx context.Context) {
|
|||||||
defer wg.Done()
|
defer wg.Done()
|
||||||
diskPath := disk.Endpoint().Path
|
diskPath := disk.Endpoint().Path
|
||||||
readDirFn(pathJoin(diskPath, minioMetaTmpDeletedBucket), func(ddir string, typ os.FileMode) error {
|
readDirFn(pathJoin(diskPath, minioMetaTmpDeletedBucket), func(ddir string, typ os.FileMode) error {
|
||||||
wait := er.deletedCleanupSleeper.Timer(ctx)
|
wait := deletedCleanupSleeper.Timer(ctx)
|
||||||
removeAll(pathJoin(diskPath, minioMetaTmpDeletedBucket, ddir))
|
removeAll(pathJoin(diskPath, minioMetaTmpDeletedBucket, ddir))
|
||||||
wait()
|
wait()
|
||||||
return nil
|
return nil
|
||||||
|
@ -381,6 +381,10 @@ var (
|
|||||||
|
|
||||||
globalConnReadDeadline time.Duration
|
globalConnReadDeadline time.Duration
|
||||||
globalConnWriteDeadline time.Duration
|
globalConnWriteDeadline time.Duration
|
||||||
|
|
||||||
|
// Controller for deleted file sweeper.
|
||||||
|
deletedCleanupSleeper = newDynamicSleeper(5, 25*time.Millisecond, false)
|
||||||
|
|
||||||
// Add new variable global values here.
|
// Add new variable global values here.
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user