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

Added a new flag for maximum retention bytes for thanos #6944

Merged
merged 3 commits into from Dec 3, 2023
Merged

Added a new flag for maximum retention bytes for thanos #6944

merged 3 commits into from Dec 3, 2023

Conversation

kartikaysaxena
Copy link
Contributor

@kartikaysaxena kartikaysaxena commented Nov 30, 2023

This PR is about the issue (#6921 )

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

Made a few changes in receive.go and ran make docs and make check-docs.

Verification

Ran receive of thanos

Signed-off-by: Kartikay <120778728+kartikaysaxena@users.noreply.github.com>
@kartikaysaxena
Copy link
Contributor Author

@MichaHoffmann @GiedriusS @yeya24 Can you please take a look?

@@ -916,6 +918,8 @@ func (rc *receiveConfig) registerFlag(cmd extkingpin.FlagClause) {

cmd.Flag("tsdb.allow-overlapping-blocks", "Allow overlapping blocks, which in turn enables vertical compaction and vertical query merge. Does not do anything, enabled all the time.").Default("false").BoolVar(&rc.tsdbAllowOverlappingBlocks)

cmd.Flag("tsdb.max-block-bytes", "Maximum size for local TSDB blocks").Default("0").Int64Var(&rc.tsdbMaxBytes)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use BytesVar instead? https://github.com/prometheus/prometheus/blob/main/cmd/prometheus/main.go#L327

Also please extend the flag description similar to the one in Prometheus. We probably also need to mention it is per tenant TSDB

Signed-off-by: Kartikay <120778728+kartikaysaxena@users.noreply.github.com>
@kartikaysaxena
Copy link
Contributor Author

Implemented BytesVar instead of Int64Var and updated the description. Also ran make docs for automatic doc update.

yeya24
yeya24 previously approved these changes Dec 3, 2023
Copy link
Contributor

@yeya24 yeya24 left a comment

Choose a reason for hiding this comment

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

Nice. Thanks for the contribution! @kartikaysaxena

@yeya24
Copy link
Contributor

yeya24 commented Dec 3, 2023

@kartikaysaxena Can you help update the changelog Added section as well?

@kartikaysaxena
Copy link
Contributor Author

Nice. Thanks for the contribution! @kartikaysaxena

Glad to help!

@kartikaysaxena
Copy link
Contributor Author

@kartikaysaxena Can you help update the changelog Added section as well?

Sure.

Signed-off-by: Kartikay <kartikay_2101ce32@iitp.ac.in>
@kartikaysaxena
Copy link
Contributor Author

@yeya24 please PTAL

@@ -916,6 +919,8 @@ func (rc *receiveConfig) registerFlag(cmd extkingpin.FlagClause) {

cmd.Flag("tsdb.allow-overlapping-blocks", "Allow overlapping blocks, which in turn enables vertical compaction and vertical query merge. Does not do anything, enabled all the time.").Default("false").BoolVar(&rc.tsdbAllowOverlappingBlocks)

cmd.Flag("tsdb.max-retention-bytes", "Maximum number of bytes that can be stored for blocks. A unit is required, supported units: B, KB, MB, GB, TB, PB, EB. Ex: \"512MB\". Based on powers-of-2, so 1KB is 1024B.").Default("0").BytesVar(&rc.tsdbMaxBytes)
Copy link
Contributor

Choose a reason for hiding this comment

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

This probably should still mention that this is per tenant right?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah we can mention it explicitly for clarity. @kartikaysaxena
All the flags with tsdb. prefix are per-tenant though.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thats true! Lets issue a followup with a small note in the docs that this limit ( and all tsdb flags ) are per tenant. Just for clarity, but that should not block this PR then.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alright, I'll create an issue regarding this and raise a PR to fix this :)

Copy link
Contributor

@MichaHoffmann MichaHoffmann left a comment

Choose a reason for hiding this comment

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

lgtm

@yeya24 yeya24 merged commit 2de1266 into thanos-io:main Dec 3, 2023
20 checks passed
@calestyo
Copy link

calestyo commented Dec 6, 2023

Just wondered because of the description: Is this really the total amount of storage that all blocks together (per tenant) may occupy? Description could also be interpreted as if that were the maximum storage per block.

@MichaHoffmann
Copy link
Contributor

I think its a limit for the space of a local tsdb ( per tenant )

@calestyo
Copy link

calestyo commented Dec 6, 2023

btw: It doesn't matter that much for me personally, since I anyway have only one tenant... but the limit would IMO make more sense if it were a total limit over all tenants.

A file system doesn't care how many tenants there are, when it runs full.

@MichaHoffmann
Copy link
Contributor

btw: It doesn't matter that much for me personally, since I anyway have only one tenant... but the limit would IMO make more sense if it were a total limit over all tenants. A file system doesn't care how many tenants there are, when it runs full.

Yes it is a bit unfortunate but a good start nonetheless i think.

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.

None yet

4 participants