@@ -101,10 +101,10 @@ func convertToShortRef(ref *logproto.ChunkRef) *logproto.ShortRef {
101101 return & logproto.ShortRef {From : ref .From , Through : ref .Through , Checksum : ref .Checksum }
102102}
103103
104- func (bq * BloomQuerier ) FilterChunkRefs (ctx context.Context , tenant string , from , through model.Time , chunkRefs []* logproto.ChunkRef , queryPlan plan.QueryPlan ) ([]* logproto.ChunkRef , error ) {
104+ func (bq * BloomQuerier ) FilterChunkRefs (ctx context.Context , tenant string , from , through model.Time , chunkRefs []* logproto.ChunkRef , queryPlan plan.QueryPlan ) ([]* logproto.ChunkRef , bool , error ) {
105105 // Shortcut that does not require any filtering
106106 if ! bq .limits .BloomGatewayEnabled (tenant ) || len (chunkRefs ) == 0 || len (v1 .ExtractTestableLabelMatchers (queryPlan .AST )) == 0 {
107- return chunkRefs , nil
107+ return chunkRefs , false , nil
108108 }
109109
110110 logger , ctx := spanlogger .NewWithLogger (ctx , bq .logger , "bloomquerier.FilterChunkRefs" )
@@ -140,7 +140,7 @@ func (bq *BloomQuerier) FilterChunkRefs(ctx context.Context, tenant string, from
140140 bq .metrics .seriesTotal .Add (float64 (preFilterSeries ))
141141 bq .metrics .seriesFiltered .Add (0 )
142142
143- return chunkRefs , nil
143+ return chunkRefs , false , nil
144144 }
145145 }
146146
@@ -152,12 +152,12 @@ func (bq *BloomQuerier) FilterChunkRefs(ctx context.Context, tenant string, from
152152 day := bloomshipper .NewInterval (s .day .Time , s .day .Add (Day ))
153153 blocks , skipped , err := bq .blockResolver .Resolve (ctx , tenant , day , s .series )
154154 if err != nil {
155- return nil , err
155+ return nil , false , err
156156 }
157157
158158 refs , err := bq .c .FilterChunks (ctx , tenant , s .interval , blocks , queryPlan )
159159 if err != nil {
160- return nil , err
160+ return nil , false , err
161161 }
162162
163163 skippedGrps = append (skippedGrps , skipped )
@@ -167,7 +167,7 @@ func (bq *BloomQuerier) FilterChunkRefs(ctx context.Context, tenant string, from
167167 // add chunk refs from series that were not mapped to any blocks
168168 skippedDeduped , err := mergeSeries (skippedGrps , nil )
169169 if err != nil {
170- return nil , errors .Wrap (err , "failed to dedupe skipped series" )
170+ return nil , false , errors .Wrap (err , "failed to dedupe skipped series" )
171171 }
172172
173173 var chunksSkipped int
@@ -177,7 +177,7 @@ func (bq *BloomQuerier) FilterChunkRefs(ctx context.Context, tenant string, from
177177
178178 deduped , err := mergeSeries (responses , nil )
179179 if err != nil {
180- return nil , errors .Wrap (err , "failed to dedupe results" )
180+ return nil , false , errors .Wrap (err , "failed to dedupe results" )
181181 }
182182
183183 result := make ([]* logproto.ChunkRef , 0 , len (chunkRefs ))
@@ -218,7 +218,7 @@ func (bq *BloomQuerier) FilterChunkRefs(ctx context.Context, tenant string, from
218218 bq .metrics .seriesSkipped .Add (float64 (len (skippedDeduped )))
219219 bq .metrics .seriesFiltered .Add (float64 (preFilterSeries - postFilterSeries ))
220220
221- return result , nil
221+ return result , true , nil
222222}
223223
224224// groupChunkRefs takes a slice of chunk refs sorted by their fingerprint and
0 commit comments