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

query-frontend: Allow for multiple topics in readConsistencyRoundTripper #10220

Merged
merged 5 commits into from
Dec 20, 2024

Conversation

leizor
Copy link
Contributor

@leizor leizor commented Dec 11, 2024

What this PR does

Adjust readConsistencyRoundTripper to take a map of header keys to offsets readers, allowing it to support the tracking of the produced offsets of multiple topics.

Which issue(s) this PR fixes or relates to

Checklist

  • Tests updated.
  • Documentation added.
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX].
  • about-versioning.md updated with experimental features.

@leizor leizor force-pushed the leizor/read-consistency-round-tripper-2 branch from 4caad1c to 6591673 Compare December 11, 2024 20:11
@leizor leizor marked this pull request as ready for review December 11, 2024 20:30
@leizor leizor requested a review from a team as a code owner December 11, 2024 20:30
@leizor leizor marked this pull request as draft December 11, 2024 21:34
@leizor leizor marked this pull request as ready for review December 12, 2024 01:51
Copy link
Collaborator

@pracucci pracucci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, LGTM!

Please rebase with main. I've done some small changes to reader metrics, but shouldn't be an issue to merge with your changes.

return t.QueryFrontendTopicOffsetsReader, nil
ingestTopicOffsetsReader := ingest.NewTopicOffsetsReader(kafkaClient, t.Cfg.IngestStorage.KafkaConfig.Topic, getPartitionIDs, t.Cfg.IngestStorage.KafkaConfig.LastProducedOffsetPollInterval, t.Registerer, util_log.Logger)

t.QueryFrontendTopicOffsetsReaders = map[string]*ingest.TopicOffsetsReader{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how you will integrate in GEM, but I'm wondering if we should check if the t.QueryFrontendTopicOffsetsReaders already exists and, if so, just add the entry to it, so that we don't overwrite the map in case GEM initialization happens earlier.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was planning to add the new aggregations topic offsets reader module as dependent on this QueryFrontendTopicOffsetsReaders module, but it does seem safer to do the check you suggested - added in 68bc274.


r.Service = services.NewBasicService(r.start, r.run, r.stop)
return r, nil
}

func (r *PartitionReader) Topic() string {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] Is this ever used? I can't see it on a first sight.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're correct - accidentally left this from an abandoned attempt at adding the topic label to the read consistency metrics. Removed in d3c9d1d!

@leizor leizor force-pushed the leizor/read-consistency-round-tripper-2 branch from 5e0a00c to d3c9d1d Compare December 20, 2024 19:41
@leizor
Copy link
Contributor Author

leizor commented Dec 20, 2024

Thanks for the review @pracucci!

@leizor leizor merged commit 79c32ab into main Dec 20, 2024
29 checks passed
@leizor leizor deleted the leizor/read-consistency-round-tripper-2 branch December 20, 2024 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants