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

Apply maximum block size limit during bloom compaction #11681

Closed
wants to merge 6 commits into from

Conversation

salvacorts
Copy link
Contributor

@salvacorts salvacorts commented Jan 15, 2024

What this PR does / why we need it:

This PR adds a new per-tenant limit bloom_compactor_max_block_size that adjusts the maximum size of the bloom blocks the bloom-compactor builds. By default this limit is unset so blocks can be arbitrarily big.

The block builder keeps adding series' blooms to a block until the limit is exceeded, meaning that blocks may grow beyond the configured maximum. This is needed so we avoid having tiny blocks which had space for small blooms but later a bigger blooms didn't fit.

Special notes for your reviewer:

Checklist

  • Reviewed the CONTRIBUTING.md guide (required)
  • Documentation added
  • Tests updated
  • CHANGELOG.md updated
    • If the change is worth mentioning in the release notes, add add-to-release-notes label
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/setup/upgrade/_index.md
  • For Helm chart changes bump the Helm chart version in production/helm/loki/Chart.yaml and update production/helm/loki/CHANGELOG.md and production/helm/loki/README.md. Example PR
  • If the change is deprecating or removing a configuration option, update the deprecated-config.yaml and deleted-config.yaml files respectively in the tools/deprecated-config-checker directory. Example PR

@github-actions github-actions bot added the type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories label Jan 15, 2024
@salvacorts salvacorts force-pushed the salvacorts/max-size-bloom-blocks branch from c416b19 to e77de93 Compare January 15, 2024 15:42
@salvacorts salvacorts marked this pull request as ready for review January 16, 2024 16:11
@salvacorts salvacorts requested a review from a team as a code owner January 16, 2024 16:11
Copy link
Contributor

@vlad-diachenko vlad-diachenko left a comment

Choose a reason for hiding this comment

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

looks great 👍

pkg/validation/limits.go Outdated Show resolved Hide resolved
pkg/bloomcompactor/chunkcompactor.go Outdated Show resolved Hide resolved
pkg/bloomcompactor/bloomcompactor.go Outdated Show resolved Hide resolved
pkg/storage/bloom/v1/builder.go Outdated Show resolved Hide resolved
pkg/bloomcompactor/chunkcompactor.go Outdated Show resolved Hide resolved
pkg/bloomcompactor/chunkcompactor.go Outdated Show resolved Hide resolved
pkg/bloomcompactor/mergecompactor.go Show resolved Hide resolved
pkg/bloomcompactor/mergecompactor.go Outdated Show resolved Hide resolved
pkg/storage/bloom/v1/builder.go Outdated Show resolved Hide resolved
pkg/storage/bloom/v1/builder.go Outdated Show resolved Hide resolved
@@ -54,6 +57,7 @@ func NewBlockBuilder(opts BlockOptions, writer BlockWriter) (*BlockBuilder, erro

return &BlockBuilder{
opts: opts,
writer: writer,
Copy link
Contributor

Choose a reason for hiding this comment

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

As far as I see, the writer is only used to determine the size of the block after each population cycle.
Instead of adding the writer to the block builder, could we just use an int type that stores the current size?

Copy link
Contributor Author

@salvacorts salvacorts Jan 18, 2024

Choose a reason for hiding this comment

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

To get the Size you need access to the writer. I don't think we can just have an in in the builder, how would you set that int without access to the writer?

@salvacorts
Copy link
Contributor Author

Closing in favor of #11878

@salvacorts salvacorts closed this Feb 6, 2024
@salvacorts salvacorts deleted the salvacorts/max-size-bloom-blocks branch December 20, 2024 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XXL type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants