mirror of
https://github.com/minio/minio.git
synced 2025-11-24 03:27:44 -05:00
Avoid excessive listing attempts in the daily sweep (#8081)
Add better dynamic timeouts for locks, also add jitters before launching daily sweep to ensure that not all the servers in distributed setup are not trying to hold locks to begin the sweep round. Also, add enough delay for incoming requests based on totalSetCount*totalDriveCount. A possible fix for #8071
This commit is contained in:
@@ -103,14 +103,12 @@ func startDailyLifecycle() {
|
||||
}
|
||||
}
|
||||
|
||||
var lifecycleTimeout = newDynamicTimeout(60*time.Second, time.Second)
|
||||
|
||||
func lifecycleRound(ctx context.Context, objAPI ObjectLayer) error {
|
||||
|
||||
zeroDuration := time.Millisecond
|
||||
zeroDynamicTimeout := newDynamicTimeout(zeroDuration, zeroDuration)
|
||||
|
||||
// Lock to avoid concurrent lifecycle ops from other nodes
|
||||
sweepLock := globalNSMutex.NewNSLock(ctx, "system", "daily-lifecycle-ops")
|
||||
if err := sweepLock.GetLock(zeroDynamicTimeout); err != nil {
|
||||
if err := sweepLock.GetLock(lifecycleTimeout); err != nil {
|
||||
return err
|
||||
}
|
||||
defer sweepLock.Unlock()
|
||||
|
||||
Reference in New Issue
Block a user