allow server startup to come online with READ success (#19957)

This commit is contained in:
Harshavardhana 2024-06-19 22:21:31 -07:00 committed by GitHub
parent bce93b5cfa
commit 2825294b7b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 4 deletions

View file

@ -2425,7 +2425,6 @@ const (
type HealthOptions struct {
Maintenance bool
DeploymentType string
Startup bool
}
// HealthResult returns the current state of the system, also

View file

@ -921,14 +921,14 @@ func serverMain(ctx *cli.Context) {
}
bootstrapTrace("waitForQuorum", func() {
result := newObject.Health(context.Background(), HealthOptions{Startup: true})
for !result.Healthy {
result := newObject.Health(context.Background(), HealthOptions{})
for !result.HealthyRead {
if debugNoExit {
logger.Info("Not waiting for quorum since we are debugging.. possible cause unhealthy sets (%s)", result)
break
}
d := time.Duration(r.Float64() * float64(time.Second))
logger.Info("Waiting for quorum healthcheck to succeed.. possible cause unhealthy sets (%s), retrying in %s", result, d)
logger.Info("Waiting for quorum READ healthcheck to succeed.. possible cause unhealthy sets (%s), retrying in %s", result, d)
time.Sleep(d)
result = newObject.Health(context.Background(), HealthOptions{})
}