@ -22,6 +22,7 @@ import (
"io"
"io"
"math/rand"
"math/rand"
"net/http"
"net/http"
"strconv"
"strings"
"strings"
"sync"
"sync"
"time"
"time"
@ -2063,6 +2064,8 @@ func (z *erasureZones) Health(ctx context.Context, opts HealthOptions) HealthRes
}
}
}
}
reqInfo := ( & logger . ReqInfo { } ) . AppendTags ( "maintenance" , strconv . FormatBool ( opts . Maintenance ) )
for zoneIdx := range erasureSetUpCount {
for zoneIdx := range erasureSetUpCount {
parityDrives := globalStorageClass . GetParityForSC ( storageclass . STANDARD )
parityDrives := globalStorageClass . GetParityForSC ( storageclass . STANDARD )
diskCount := z . zones [ zoneIdx ] . drivesPerSet
diskCount := z . zones [ zoneIdx ] . drivesPerSet
@ -2076,7 +2079,8 @@ func (z *erasureZones) Health(ctx context.Context, opts HealthOptions) HealthRes
}
}
for setIdx := range erasureSetUpCount [ zoneIdx ] {
for setIdx := range erasureSetUpCount [ zoneIdx ] {
if erasureSetUpCount [ zoneIdx ] [ setIdx ] < writeQuorum {
if erasureSetUpCount [ zoneIdx ] [ setIdx ] < writeQuorum {
logger . LogIf ( ctx , fmt . Errorf ( "Write quorum lost on zone: %d, set: %d, expected write quorum: %d" ,
logger . LogIf ( logger . SetReqInfo ( ctx , reqInfo ) ,
fmt . Errorf ( "Write quorum may be lost on zone: %d, set: %d, expected write quorum: %d" ,
zoneIdx , setIdx , writeQuorum ) )
zoneIdx , setIdx , writeQuorum ) )
return HealthResult {
return HealthResult {
Healthy : false ,
Healthy : false ,
@ -2101,14 +2105,14 @@ func (z *erasureZones) Health(ctx context.Context, opts HealthOptions) HealthRes
// is not taken down for maintenance
// is not taken down for maintenance
aggHealStateResult , err := getAggregatedBackgroundHealState ( ctx , true )
aggHealStateResult , err := getAggregatedBackgroundHealState ( ctx , true )
if err != nil {
if err != nil {
logger . LogIf ( ctx , fmt . Errorf ( "Unable to verify global heal status: %w" , err ) )
logger . LogIf ( logger . SetReqInfo ( ctx , reqInfo ) , fmt . Errorf ( "Unable to verify global heal status: %w" , err ) )
return HealthResult {
return HealthResult {
Healthy : false ,
Healthy : false ,
}
}
}
}
if len ( aggHealStateResult . HealDisks ) > 0 {
if len ( aggHealStateResult . HealDisks ) > 0 {
logger . LogIf ( ctx , fmt . Errorf ( "Total drives to be healed %d" , len ( aggHealStateResult . HealDisks ) ) )
logger . LogIf ( logger . SetReqInfo ( ctx , reqInfo ) , fmt . Errorf ( "Total drives to be healed %d" , len ( aggHealStateResult . HealDisks ) ) )
}
}
healthy := len ( aggHealStateResult . HealDisks ) == 0
healthy := len ( aggHealStateResult . HealDisks ) == 0