mirror of
https://github.com/minio/minio.git
synced 2025-11-09 21:49:46 -05:00
Heal only when atleast one of the disk is unformatted (#5866)
Current healing has an issue when disks are healed even when they are offline without knowing if disk is unformatted. This can lead to issues of pre-maturely removing the disk from the set just because it was temporarily offline. There is an increasing number of `mc admin heal` usage on a cron or regular basis. It is possible that if healing code saw disk is offline it might prematurely take it down, this causes availability issues. Fixes #5826
This commit is contained in:
committed by
Nitish Tiwari
parent
e43cd0d5c8
commit
5f9041571f
@@ -288,10 +288,10 @@ func formatXLMigrateV2ToV3(export string) error {
|
||||
return ioutil.WriteFile(formatPath, b, 0644)
|
||||
}
|
||||
|
||||
// Returns true, if one of the errors is non-nil.
|
||||
func hasAnyErrors(errs []error) bool {
|
||||
// Returns true, if one of the errors is non-nil and is Unformatted disk.
|
||||
func hasAnyErrorsUnformatted(errs []error) bool {
|
||||
for _, err := range errs {
|
||||
if err != nil {
|
||||
if err != nil && err == errUnformattedDisk {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user