-
Notifications
You must be signed in to change notification settings - Fork 549
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
rhythm: fix block time range adjustment #4746
rhythm: fix block time range adjustment #4746
Conversation
if end.Before(start) { | ||
warn = true | ||
end = start | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just wrong data, no? I don't think we have to fix it, or at least it's not related to ingestion slack.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean end.Before(startOfRange)
instead?
if end.Before(start) { | |
warn = true | |
end = start | |
} | |
if end.Before(startOfRange) { | |
warn = true | |
end = start | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not wrong data, old data. Imagine someone wants to add old spans into Tempo
I did a very similar fix a time ago:
#3954
We need to correct the end date or the block will be wrong
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using start
instead of startOfRange
makes sense to me because it addresses both scenarios. If the start
is before the startOfRange
it has been already adjusted. In the edge case where end < startOfRange < start
it fixes it as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the edge case where end < startOfRange < start it fixes it as well
This is what I meant by wrong data, end < start
is logically incorrect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Internally during a test block builders flushed several blocks in a row with meta.start==meta.end. I'm not sure that this change is the fix, because the only related change is the case end after endOfRange
. Previously it was set to start
and now it's endOfRange
. For this to be the issue it would have to mean that every trace in the block was a long-running one that exceeds the buffer s.startTime.Add(s.slackDuration + s.cycleDuration)
. I'd like to dig more and see if there is another explanation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I think end.Before(start)
is safe but feels a bit strange.
if end.Before(start) { | ||
warn = true | ||
end = start | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the edge case where end < startOfRange < start it fixes it as well
This is what I meant by wrong data, end < start
is logically incorrect.
What this PR does:
This fixes the previous behavior, where the end date was always set to the start time. This was a translation of our behavior in the ingesters, where the start and end dates are set to now() if they are outside the time range.
How it works now:
It checks independently the start and the end.
If the end is before the start it will set it to the start
If the end is after the end range it will set it to the end range
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]