Skip to content

Commit

Permalink
Short-circuit chunk dedup in proxy (thanos-io#5816)
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 <filip.petkovsky@gmail.com>

Signed-off-by: Filip Petkovski <filip.petkovsky@gmail.com>
  • Loading branch information
fpetkovski authored and GiedriusS committed Oct 31, 2022
1 parent a6ba543 commit 7174724
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/store/proxy_heap.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ func (d *dedupResponseHeap) At() *storepb.SeriesResponse {
if _, ok := chunkDedupMap[hash]; !ok {
chk := chk
chunkDedupMap[hash] = &chk
break
}
}
}
Expand Down

0 comments on commit 7174724

Please sign in to comment.