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

Fix possible division by zero during compactor config validation #5535

Merged

Conversation

kralicky
Copy link
Contributor

What this PR does:

This adds additional validation logic to ensure there are no duration values of zero in the compactor's BlockRanges config. If there are, the next validation rule would panic when trying to divide by zero.

(I considered adding the check to the existing code, but a period of 0 here is invalid anyway, for a different reason)

Which issue(s) this PR fixes:
Fixes #

Checklist

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

Signed-off-by: Joe Kralicky <joe.kralicky@suse.com>
@kralicky kralicky force-pushed the fix-validation-divide-by-zero branch from 4e0546b to 3969ccd Compare August 29, 2023 00:05
Copy link
Collaborator

@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.

Thanks!

@alanprot
Copy link
Member

LGTM, thanks

@alanprot alanprot merged commit f240583 into cortexproject:master Aug 30, 2023
14 checks passed
@kralicky kralicky deleted the fix-validation-divide-by-zero branch August 30, 2023 18:09
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

3 participants