-
Notifications
You must be signed in to change notification settings - Fork 828
add context cancellation checks on GetSeries #5827
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -437,7 +437,7 @@ func (q querier) Select(ctx context.Context, sortSeries bool, sp *storage.Select | |
// we have all the sets from different sources (chunk from store, chunks from ingesters, | ||
// time series from store and time series from ingesters). | ||
// mergeSeriesSets will return sorted set. | ||
return q.mergeSeriesSets(result) | ||
return q.mergeSeriesSets(ctx, result) | ||
} | ||
|
||
// LabelValues implements storage.Querier. | ||
|
@@ -553,7 +553,7 @@ func (querier) Close() error { | |
return nil | ||
} | ||
|
||
func (q querier) mergeSeriesSets(sets []storage.SeriesSet) storage.SeriesSet { | ||
func (q querier) mergeSeriesSets(ctx context.Context, sets []storage.SeriesSet) storage.SeriesSet { | ||
// Here we deal with sets that are based on chunks and build single set from them. | ||
// Remaining sets are merged with chunks-based one using storage.NewMergeSeriesSet | ||
|
||
|
@@ -565,6 +565,9 @@ func (q querier) mergeSeriesSets(sets []storage.SeriesSet) storage.SeriesSet { | |
|
||
// SeriesSet may have some series backed up by chunks, and some not. | ||
for set.Next() { | ||
if ctx.Err() != nil { | ||
return storage.ErrSeriesSet(ctx.Err()) | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we did something similar and thanos and the perf was ok, right @yeya24 ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have something like this when expanding postings. No obvious impact. |
||
s := set.At() | ||
|
||
if sc, ok := s.(SeriesWithChunks); ok { | ||
|
Uh oh!
There was an error while loading. Please reload this page.