diff --git a/ring/ring.go b/ring/ring.go index cd1f1dcc0..4f60b226f 100644 --- a/ring/ring.go +++ b/ring/ring.go @@ -276,14 +276,14 @@ func (r *Ring) starting(ctx context.Context) error { if err != nil { return errors.Wrap(err, "unable to initialise ring state") } - if value == nil { + if value != nil { + r.updateRingState(value.(*Desc)) + } else { level.Info(r.logger).Log("msg", "ring doesn't exist in KV store yet") - return nil } - r.updateRingState(value.(*Desc)) + // Update the ring metrics at start. r.updateRingMetrics() - // Use this channel to close the go routine to prevent leaks. r.metricsUpdateCloser = make(chan struct{}) go func() { @@ -300,6 +300,7 @@ func (r *Ring) starting(ctx context.Context) error { } } }() + return nil }