mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -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)
|
||||||
}
|
}
|
||||||
|
@ -461,17 +461,16 @@ func newErasureSets(ctx context.Context, endpoints PoolEndpoints, storageDisks [
|
|||||||
|
|
||||||
// Initialize erasure objects for a given set.
|
// Initialize erasure objects for a given set.
|
||||||
s.sets[i] = &erasureObjects{
|
s.sets[i] = &erasureObjects{
|
||||||
setIndex: i,
|
setIndex: i,
|
||||||
poolIndex: poolIdx,
|
poolIndex: poolIdx,
|
||||||
setDriveCount: setDriveCount,
|
setDriveCount: setDriveCount,
|
||||||
defaultParityCount: defaultParityCount,
|
defaultParityCount: defaultParityCount,
|
||||||
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,
|
|
||||||
}
|
}
|
||||||
}(i)
|
}(i)
|
||||||
}
|
}
|
||||||
|
@ -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