mirror of
https://github.com/minio/minio.git
synced 2025-04-20 18:44:21 -04:00
startup: Show elapsed time in disks format process (#3413)
This commit is contained in:
parent
7b7c0bba58
commit
410b579e87
@ -201,6 +201,13 @@ func retryFormattingDisks(firstDisk bool, endpoints []*url.URL, storageDisks []S
|
|||||||
// Indicate to our routine to exit cleanly upon return.
|
// Indicate to our routine to exit cleanly upon return.
|
||||||
defer close(doneCh)
|
defer close(doneCh)
|
||||||
|
|
||||||
|
// prepare getElapsedTime() to calculate elapsed time since we started trying formatting disks.
|
||||||
|
// All times are rounded to avoid showing milli, micro and nano seconds
|
||||||
|
formatStartTime := time.Now().Round(time.Second)
|
||||||
|
getElapsedTime := func() string {
|
||||||
|
return time.Now().Round(time.Second).Sub(formatStartTime).String()
|
||||||
|
}
|
||||||
|
|
||||||
// Wait on the jitter retry loop.
|
// Wait on the jitter retry loop.
|
||||||
retryTimerCh := newRetryTimer(time.Second, time.Second*30, MaxJitter, doneCh)
|
retryTimerCh := newRetryTimer(time.Second, time.Second*30, MaxJitter, doneCh)
|
||||||
for {
|
for {
|
||||||
@ -239,16 +246,18 @@ func retryFormattingDisks(firstDisk bool, endpoints []*url.URL, storageDisks []S
|
|||||||
return err
|
return err
|
||||||
case WaitForQuorum:
|
case WaitForQuorum:
|
||||||
console.Printf(
|
console.Printf(
|
||||||
"Initializing data volume. Waiting for minimum %d servers to come online.\n",
|
"Initializing data volume. Waiting for minimum %d servers to come online. (elapsed %s)\n",
|
||||||
len(storageDisks)/2+1,
|
len(storageDisks)/2+1, getElapsedTime(),
|
||||||
)
|
)
|
||||||
case WaitForConfig:
|
case WaitForConfig:
|
||||||
// Print configuration errors.
|
// Print configuration errors.
|
||||||
printConfigErrMsg(storageDisks, sErrs, printOnceFn())
|
printConfigErrMsg(storageDisks, sErrs, printOnceFn())
|
||||||
case WaitForAll:
|
case WaitForAll:
|
||||||
console.Println("Initializing data volume for first time. Waiting for other servers to come online")
|
console.Printf("Initializing data volume for first time. Waiting for other servers to come online (elapsed %s)\n",
|
||||||
|
getElapsedTime())
|
||||||
case WaitForFormatting:
|
case WaitForFormatting:
|
||||||
console.Println("Initializing data volume for first time. Waiting for first server to come online")
|
console.Println("Initializing data volume for first time. Waiting for first server to come online (elapsed %s)\n",
|
||||||
|
getElapsedTime())
|
||||||
}
|
}
|
||||||
continue
|
continue
|
||||||
} // else We have FS backend now. Check fs format as well now.
|
} // else We have FS backend now. Check fs format as well now.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user