Skip to content

fix(v2): allow empty ring in segment-writer client #4124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions pkg/experiment/ingester/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,17 +187,21 @@ func (c *Client) starting(ctx context.Context) error {
// Warm up connections. The pool does not do this.
instances, err := c.ring.GetAllHealthy(ring.Reporting)
if err != nil {
return fmt.Errorf("get all healthy instances: %w", err)
}
var wg sync.WaitGroup
for _, x := range instances.Instances {
wg.Add(1)
go func(x ring.InstanceDesc) {
defer wg.Done()
_, _ = c.pool.GetClientFor(x.Addr)
}(x)
// The ring might be empty initially if the segment-writer service
// is not yet ready. In such cases, we avoid failing the client to
// allow for eventual readiness.
level.Debug(c.logger).Log("msg", "unable to create connections", "err", err)
} else {
var wg sync.WaitGroup
for _, x := range instances.Instances {
wg.Add(1)
go func(x ring.InstanceDesc) {
defer wg.Done()
_, _ = c.pool.GetClientFor(x.Addr)
}(x)
}
wg.Wait()
}
wg.Wait()
return services.StartManagerAndAwaitHealthy(ctx, c.subservices)
}

Expand Down
Loading