add configurable delta for skipping shards (#13967)

This PR is an attempt to make this configurable
as not all situations have same level of tolerable
delta, i.e disks are replaced days apart or even
hours.

There is also a possibility that nodes have drifted
in time, when NTP is not configured on the system.
This commit is contained in:
Harshavardhana
2021-12-22 11:43:01 -08:00
committed by GitHub
parent ebd78e983f
commit 54ec0a1308
6 changed files with 28 additions and 9 deletions

View File

@@ -67,6 +67,7 @@ import (
// serverDebugLog will enable debug printing
var serverDebugLog = env.Get("_MINIO_SERVER_DEBUG", config.EnableOff) == config.EnableOn
var shardDiskTimeDelta time.Duration
var defaultAWSCredProvider []credentials.Provider
func init() {
@@ -136,6 +137,12 @@ func init() {
},
}
var err error
shardDiskTimeDelta, err = time.ParseDuration(env.Get("_MINIO_SHARD_DISKTIME_DELTA", "1m"))
if err != nil {
shardDiskTimeDelta = 1 * time.Minute
}
// All minio-go API operations shall be performed only once,
// another way to look at this is we are turning off retries.
minio.MaxRetry = 1