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-2167: tempodb integer divide by zero error #2333

Merged
merged 4 commits into from
Apr 17, 2023

Conversation

mghildiy
Copy link
Contributor

@mghildiy mghildiy commented Apr 13, 2023

What this PR does:
This PR solves the 'divison by zero' error occurring during compaction.

Which issue(s) this PR fixes:
Fixes #2167

Checklist

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

@CLAassistant
Copy link

CLAassistant commented Apr 13, 2023

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@joe-elliott joe-elliott left a comment

Choose a reason for hiding this comment

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

thanks for submitting a fix for this! i think you need to rebase on top of main or merge main to get up to date. that should resolve your go.mod issues.

.gitignore Outdated Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
tempodb/__debug_bin.exe Outdated Show resolved Hide resolved
tempodb/compaction_block_selector.go Outdated Show resolved Hide resolved
@mghildiy
Copy link
Contributor Author

mghildiy commented Apr 13, 2023

I merged main into my feature branch, and it somehow stopped git working. For every git command I now get:

fatal: not a git repository (or any of the parent directories): .git

Never faced it with git. Anyone having any idea?

PS: Seems it got corrupted, so I cloned once again. Please ignore this comment.

@mghildiy
Copy link
Contributor Author

I have made the recommended changes. Pleade have a look.

  • A new validation method for CompactorConfig in config.go to check that compaction range is not 0
  • Corresponding test in config_test.go.
  • Call this new method in EnableCompaction method in tempodb.go, and if it returns error, just return from the method without doing anything more.
  • Corresponding test in tempodb_test.go

Copy link
Member

@joe-elliott joe-elliott 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 restructuring. This PR is looking a lot cleaner now. Please clean up the changelog conflict and consider the small comments I've made and then we can merge.

tempodb/tempodb.go Outdated Show resolved Hide resolved
tempodb/config.go Outdated Show resolved Hide resolved
Copy link
Member

@joe-elliott joe-elliott left a comment

Choose a reason for hiding this comment

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

Nice fix! Thanks

@joe-elliott joe-elliott merged commit 4cdf859 into grafana:main Apr 17, 2023
@mghildiy
Copy link
Contributor Author

Hmmm....I am a bit surprised as I saw a test failure. And when I ran that test(TestInstance_cantWriteToWAL) locally, there too it failed. But now PR is approved.

@mghildiy mghildiy deleted the fixIssue2167 branch April 21, 2023 04:49
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.

tempodb integer divide by zero error
3 participants