@@ -187,8 +187,8 @@ func (d *Distributor) queryIngesters(ctx context.Context, replicationSet ring.Re
187
187
// queryIngesterStream queries the ingesters using the new streaming API.
188
188
func (d * Distributor ) queryIngesterStream (ctx context.Context , userID string , replicationSet ring.ReplicationSet , req * ingester_client.QueryRequest ) (* ingester_client.QueryStreamResponse , error ) {
189
189
var (
190
- maxChunksLimit = d .limits .MaxChunksPerQueryFromIngesters (userID )
191
- totChunksCount = atomic.Int32 {}
190
+ chunksLimit = d .limits .MaxChunksPerQueryFromIngesters (userID )
191
+ chunksCount = atomic.Int32 {}
192
192
)
193
193
194
194
// Fetch samples from multiple ingesters
@@ -221,13 +221,13 @@ func (d *Distributor) queryIngesterStream(ctx context.Context, userID string, re
221
221
}
222
222
223
223
// Enforce the max chunks limits.
224
- if maxChunksLimit > 0 {
225
- if totChunks := int (totChunksCount .Add (int32 (resp .ChunksCount ()))); totChunks > maxChunksLimit {
224
+ if chunksLimit > 0 {
225
+ if count := int (chunksCount .Add (int32 (resp .ChunksCount ()))); count > chunksLimit {
226
226
// We expect to be always able to convert the label matchers back to Prometheus ones.
227
227
// In case we fail (unexpected) the error will not include the matchers, but the core
228
228
// logic doesn't break.
229
229
matchers , _ := ingester_client .FromLabelMatchers (req .Matchers )
230
- return nil , validation .LimitError (fmt .Sprintf (errMaxChunksPerQueryLimit , util .LabelMatchersToString (matchers ), maxChunksLimit ))
230
+ return nil , validation .LimitError (fmt .Sprintf (errMaxChunksPerQueryLimit , util .LabelMatchersToString (matchers ), chunksLimit ))
231
231
}
232
232
}
233
233
0 commit comments