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

[Blooms] Routing & wiring for bloom building #11894

Merged
merged 8 commits into from
Feb 8, 2024

Conversation

owen-d
Copy link
Member

@owen-d owen-d commented Feb 8, 2024

A few changes wiring up bloom building logic:

  • A Router as the controlling mechanism for iterating tenants+periods, queueing work for parallel computation, determining which fingerprint ranges and tenants are owned by a replica, and waiting for it's completion
  • Updates the SimplerBloomController to accept ownership ranges, periods, and tenants as arguments for use by the Router
  • Builds a BloomTSDBStore struct around the indexshipper/storage.Client interface in order to iterate relevant TSDBs/etc

@owen-d owen-d requested a review from a team as a code owner February 8, 2024 01:16
Copy link
Collaborator

@slim-bean slim-bean left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@chaudum chaudum left a comment

Choose a reason for hiding this comment

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

lgtm

type DayTable model.Time

func (d DayTable) String() string {
return fmt.Sprintf("%d", d.ModelTime().Time().UnixNano()/int64(config.ObjectStorageIndexRequiredPeriod))
Copy link
Contributor

Choose a reason for hiding this comment

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

At some point we need to add the prefix from the schema config.

Copy link
Contributor

Choose a reason for hiding this comment

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

A string as table representation is quite confusing, because it may or may not contain the prefix.

return model.Time(d)
}

func (d DayTable) Bounds() (start, end model.Time) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could return bloomshipper.Interval.

Comment on lines +89 to +92
buf, err := io.ReadAll(data)
if err != nil {
return nil, errors.Wrap(err, "failed to read file")
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to load the full index into memory?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think this is easier (especially for now). Individual TSDBs can vary in size, but are commonly a couple hundred MB. We can optimize this if it becomes a problem, but it's easier to just load these into memory for now.

Copy link
Contributor

Choose a reason for hiding this comment

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

Makes sense

return err
}

ticker := time.NewTicker(r.interval)
Copy link
Contributor

Choose a reason for hiding this comment

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

ticker should be stopped on exit

Signed-off-by: Owen Diehl <[email protected]>
@owen-d owen-d merged commit 3a1bd41 into grafana:main Feb 8, 2024
8 checks passed
rhnasc pushed a commit to inloco/loki that referenced this pull request Apr 12, 2024
A few changes wiring up bloom building logic:
* A `Router` as the controlling mechanism for iterating tenants+periods,
queueing work for parallel computation, determining which fingerprint
ranges and tenants are owned by a replica, and waiting for it's
completion
* Updates the `SimplerBloomController` to accept ownership ranges,
periods, and tenants as arguments for use by the `Router`
* Builds a `BloomTSDBStore` struct around the
`indexshipper/storage.Client` interface in order to iterate relevant
TSDBs/etc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants