Skip to content
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

feat(kafka): Start ingester flush loop before trying to catch up from Kafka #14505

Merged
merged 1 commit into from
Oct 17, 2024
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
8 changes: 5 additions & 3 deletions pkg/ingester/ingester.go
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,10 @@ func (i *Ingester) starting(ctx context.Context) (err error) {
i.setPrepareShutdown()
}

// start our flush loop: this needs to start before the partition-reader in order for chunks to be shipped in the case of Kafka catching up.
i.loopDone.Add(1)
go i.loop()

// When kafka ingestion is enabled, we have to make sure that reader catches up replaying the partition
// BEFORE the ingester ring lifecycler is started, because once the ingester ring lifecycler will start
// it will switch the ingester state in the ring to ACTIVE.
Expand Down Expand Up @@ -646,9 +650,7 @@ func (i *Ingester) starting(ctx context.Context) (err error) {
return fmt.Errorf("failed to start partition ring lifecycler: %w", err)
}
}
// start our loop
i.loopDone.Add(1)
go i.loop()

return nil
}

Expand Down
Loading