Skip to content

Commit

Permalink
replay wal first (#525)
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Elliott <[email protected]>
  • Loading branch information
joe-elliott authored Feb 12, 2021
1 parent 3e1ea6a commit 5770322
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions modules/ingester/ingester.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
}

Expand Down

0 comments on commit 5770322

Please sign in to comment.