-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 archive storage not querying old spans older than maxSpanAge #1617
Conversation
Signed-off-by: Pavol Loffay <[email protected]>
Signed-off-by: Pavol Loffay <[email protected]>
Signed-off-by: Pavol Loffay <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #1617 +/- ##
==========================================
+ Coverage 98.74% 98.74% +<.01%
==========================================
Files 191 191
Lines 9169 9170 +1
==========================================
+ Hits 9054 9055 +1
Misses 89 89
Partials 26 26
Continue to review full report at Codecov.
|
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 - some minor issue.
I believe the only difference I can see is the searchAfter
when not using archive - can you just provide a quick explanation of why the problem occurred (i.e. what was the underlying cause)?
@@ -305,6 +321,7 @@ func (s *SpanReader) multiRead(ctx context.Context, traceIDs []model.TraceID, st | |||
indices := s.timeRangeIndices(s.spanIndexPrefix, startTime.Add(-time.Hour), endTime.Add(time.Hour)) | |||
nextTime := model.TimeAsEpochMicroseconds(startTime.Add(-time.Hour)) | |||
|
|||
fmt.Println(indices) |
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.
Still required?
TagDotReplacement: tagKeyDeDotChar, | ||
Archive: archive, |
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.
nit: formatting looks wrong here
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.
The check passed fine
Signed-off-by: Pavol Loffay <[email protected]>
TerminateAfter(maxNumSpans). | ||
Sort("startTime", true) | ||
if !archive { | ||
s.SearchAfter(nextTime) |
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 query uses scroll API https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-search-after.html.
SearchAfter
says to include results with startTime
parameter after nextTime
. In archive storage we want to include all results.
Signed-off-by: Pavol Loffay <[email protected]>
Signed-off-by: Pavol Loffay <[email protected]>
Resolves #1511