From f195fc80d4853b4ab78ba5aa0cf5098e6446b590 Mon Sep 17 00:00:00 2001 From: Joe Elliott Date: Fri, 12 Feb 2021 16:01:06 -0500 Subject: [PATCH] replay wal first Signed-off-by: Joe Elliott --- modules/ingester/ingester.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/ingester/ingester.go b/modules/ingester/ingester.go index d39df10ddc7..42fa4ac834c 100644 --- a/modules/ingester/ingester.go +++ b/modules/ingester/ingester.go @@ -88,6 +88,11 @@ func New(cfg Config, store storage.Store, limits *overrides.Overrides) (*Ingeste } func (i *Ingester) starting(ctx context.Context) error { + err := i.replayWal() + if err != nil { + return fmt.Errorf("failed to replay wal %w", err) + } + // Now that user states have been created, we can start the lifecycler. // Important: we want to keep lifecycler running until we ask it to stop, so we need to give it independent context if err := i.lifecycler.StartAsync(context.Background()); err != nil { @@ -97,11 +102,6 @@ func (i *Ingester) starting(ctx context.Context) error { return fmt.Errorf("failed to start lifecycle %w", err) } - err := i.replayWal() - if err != nil { - return fmt.Errorf("failed to replay wal %w", err) - } - return nil }