From 6ac473edcb54500e5a6731fcd2452d1935c25de2 Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Thu, 31 Oct 2024 13:13:17 +0100 Subject: [PATCH] Fix garage health check to wait for full replication factor of nodes --- go/garage/admin_client.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/go/garage/admin_client.go b/go/garage/admin_client.go index 148a8b2..f69a066 100644 --- a/go/garage/admin_client.go +++ b/go/garage/admin_client.go @@ -153,7 +153,7 @@ func (c *AdminClient) do( } // Wait will block until the instance connected to can see at least -// ReplicationFactor-1 other garage instances. If the context is canceled it +// ReplicationFactor other garage instances. If the context is canceled it // will return the context error. func (c *AdminClient) Wait(ctx context.Context) error { @@ -193,7 +193,7 @@ func (c *AdminClient) Wait(ctx context.Context) error { "numUp", numUp, ) - if numUp >= ReplicationFactor-1 { + if numUp >= ReplicationFactor { c.logger.Debug(ctx, "instance appears to be online") return nil }