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 splitting of queries when step is larger than split interval #5006

Merged
merged 1 commit into from
Jan 3, 2022

Conversation

sandeepsukhani
Copy link
Contributor

What this PR does / why we need it:
The query split interval code is written with the assumption of step always being smaller than the split interval. This causes the following problems when step is larger than the split interval:

  1. The first split is set to the same start and end time here since we find the next interval and then try to align the difference by step which would always be of smaller value than step which then makes the end time to be set to the start time.
  2. We end up with a gap in query interval because the start time of the second split would be set to + here, but the previous query did not cover any interval due to it being set to same start and end time.

Checklist

  • Tests updated

@sandeepsukhani sandeepsukhani requested a review from a team as a code owner December 27, 2021 12:31
Copy link
Member

@owen-d owen-d left a comment

Choose a reason for hiding this comment

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

NIce catch

Copy link
Contributor

@kavirajk kavirajk 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 b865afc into grafana:main Jan 3, 2022
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.

4 participants