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

BlockBuilder: Consume at startup only when lagging #9206

Closed
codesome opened this issue Sep 4, 2024 · 0 comments
Closed

BlockBuilder: Consume at startup only when lagging #9206

codesome opened this issue Sep 4, 2024 · 0 comments
Labels
enhancement New feature or request sigyn naming for the kafka-based Mimir architecture while it's still WIP

Comments

@codesome
Copy link
Member

codesome commented Sep 4, 2024

We immediately try to consume some kafka records on startup in Block Bulder.

See:

// Do initial consumption on start using current time as the point up to which we are consuming.
// To avoid small blocks at startup, we consume until the <consume interval> boundary + buffer.
cycleEnd := cycleEndAtStartup(time.Now, b.cfg.ConsumeInterval, b.cfg.ConsumeIntervalBuffer)
err := b.nextConsumeCycle(ctx, cycleEnd)
if err != nil {
if errors.Is(err, context.Canceled) {
return nil
}
return err
}

The proposal is the consume the records only if the partition was lagging by more than a consumption cycle (can be determined using the last kafka commit information). Otherwise there will be unnecessary fetching of records with no result.

For example if the last commit was for the record at 1:01 for a consumption cycle that started at 1:15, and rollout of block builder happened between 1:15-2:15, then we will try to consume the records from 1:01 to 1:15 (with cycle end of 1:15) on startup, while producing no blocks at this point.

@codesome codesome added the enhancement New feature or request label Sep 4, 2024
@codesome codesome added the sigyn naming for the kafka-based Mimir architecture while it's still WIP label Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request sigyn naming for the kafka-based Mimir architecture while it's still WIP
Projects
None yet
Development

No branches or pull requests

1 participant