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

add a ms instead of ns to end time of the rebound chunk interval #5351

Merged
merged 3 commits into from
Feb 10, 2022

Conversation

sandeepsukhani
Copy link
Contributor

What this PR does / why we need it:
While rebounding chunk with an interval, we get inclusive end time, while the iterator we use for fetching all the samples considers end time to be non-inclusive. Therefore, we added a ns to the end time to match the expectation to ensure we included all the requested log lines.

But since we have ms precise chunk intervals, which is what the deletion code works on, we lose the ns precision. So adding 1 ns makes us not include logs that have > 1 ns value. E.g., if the end time of the chunk is 1643958368443 and we have a log at 1643958368443000064, adding 1 ns while rebounding the second half of that chunk would make us not include the log line at 1643958368443000064 since the end time we passed to iterator is 1643958368443000001.

This PR fixes the issue by adding a ms instead of a ns before passing the end time to the iterator.

conversion between ms and ns loses ns precision which causes us to not include all the logs
Copy link
Contributor

@cyriltovena cyriltovena left a comment

Choose a reason for hiding this comment

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

LGTM

@sandeepsukhani sandeepsukhani merged commit 7fafe94 into grafana:main Feb 10, 2022
sandeepsukhani added a commit that referenced this pull request Feb 10, 2022
* add a ms instead of ns to end time of the rebound chunk interval

conversion between ms and ns loses ns precision which causes us to not include all the logs

* improve error when failing to rebound chunk
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