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

Check for errors when iterating through chunks or samples in response to a query #6451

Merged
merged 5 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
* [BUGFIX] Querier: reduce log volume when querying ingesters with zone-awareness enabled and one or more instances in a single zone unavailable. #6381
* [BUGFIX] Querier: don't try to query further ingesters if ingester query request minimization is enabled and a query limit is reached as a result of the responses from the initial set of ingesters. #6402
* [BUGFIX] Ingester: Don't cache context cancellation error when querying. #6446
* [BUGFIX] Ingester: don't ignore errors encountered while iterating through chunks or samples in response to a query request. #6469
* [BUGFIX] Ingester: don't ignore errors encountered while iterating through chunks or samples in response to a query request. #6451 #6469
* [BUGFIX] All: fix issue where traces for some inter-component gRPC calls would incorrectly show the call as failing due to cancellation. #6470

### Mixin
Expand Down
14 changes: 14 additions & 0 deletions pkg/ingester/ingester.go
Original file line number Diff line number Diff line change
Expand Up @@ -1765,6 +1765,11 @@ func (i *Ingester) executeSamplesQuery(ctx context.Context, db *userTSDB, from,
return 0, 0, fmt.Errorf("unsupported value type: %v", valType)
}
}

if err := it.Err(); err != nil {
return 0, 0, err
}

numSamples += len(ts.Samples) + len(ts.Histograms)
numSeries++
tsSize := ts.Size()
Expand Down Expand Up @@ -1861,6 +1866,11 @@ func (i *Ingester) executeChunksQuery(ctx context.Context, db *userTSDB, from, t
ts.Chunks = append(ts.Chunks, ch)
numSamples += meta.Chunk.NumSamples()
}

if err := it.Err(); err != nil {
return 0, 0, err
}

numSeries++
tsSize := ts.Size()

Expand Down Expand Up @@ -2080,6 +2090,10 @@ func (i *Ingester) sendStreamingQueryChunks(allSeries *chunkSeriesNode, stream c
numSamples += meta.Chunk.NumSamples()
}

if err := it.Err(); err != nil {
return 0, 0, 0, err
}

numChunks += len(seriesChunks.Chunks)
msgSize := seriesChunks.Size()

Expand Down