From a39588abd1a0166ff3c24c80ac73e121fbff7193 Mon Sep 17 00:00:00 2001 From: Filip Petkovski Date: Tue, 25 Oct 2022 09:28:09 +0200 Subject: [PATCH] Short-circuit chunk dedup in proxy 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 --- pkg/store/proxy_heap.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/store/proxy_heap.go b/pkg/store/proxy_heap.go index 558ffcb69b..d354d4db06 100644 --- a/pkg/store/proxy_heap.go +++ b/pkg/store/proxy_heap.go @@ -139,6 +139,7 @@ func (d *dedupResponseHeap) At() *storepb.SeriesResponse { if _, ok := chunkDedupMap[hash]; !ok { chk := chk chunkDedupMap[hash] = &chk + break } } }