Skip to content

Commit

Permalink
Short-circuit chunk dedup in proxy
Browse files Browse the repository at this point in the history
The store proxy deduplicates series by calculating a hash on the each
aggregate chunk. If at least one hash is not present in the dedup-map,
the entire series chunk is added to the response, including all aggregate
chunks.

Because of this, we can short-circuit deduping chunks and stop early if any
aggregate chunks is not previously seen.

Signed-off-by: Filip Petkovski <[email protected]>
  • Loading branch information
fpetkovski committed Oct 25, 2022
1 parent 3642334 commit cc4e607
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/store/proxy_heap.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/prometheus/model/labels"

"github.com/thanos-io/thanos/pkg/store/labelpb"
"github.com/thanos-io/thanos/pkg/store/storepb"
"github.com/thanos-io/thanos/pkg/tracing"
Expand Down Expand Up @@ -134,8 +135,8 @@ func (d *dedupResponseHeap) At() *storepb.SeriesResponse {

if _, ok := chunkDedupMap[h]; !ok {
chk := chk

chunkDedupMap[h] = &chk
break
}
}

Expand Down

0 comments on commit cc4e607

Please sign in to comment.