Skip to content

Commit

Permalink
Address feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>
  • Loading branch information
saswatamcode authored and fpetkovski committed Jul 21, 2023
1 parent 467b7b2 commit a29cc58
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions pkg/store/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ func NewBucketStore(
enableSeriesResponseHints: enableSeriesResponseHints,
enableChunkHashCalculation: enableChunkHashCalculation,
seriesBatchSize: SeriesBatchSize,
labelNamesBloom: bloom.NewAlwaysTrueFilter(),
}

for _, option := range options {
Expand Down Expand Up @@ -1681,13 +1682,15 @@ func (s *BucketStore) UpdateLabelNamesBloom(ctx context.Context) error {
extRes = append(extRes, l.Name)
}

res = strutil.MergeSlices(res, extRes)

if len(res) > 0 {
mtx.Lock()
for _, n := range res {
names[n] = struct{}{}
}

for _, n := range extRes {
names[n] = struct{}{}
}
mtx.Unlock()
}

Expand Down
1 change: 1 addition & 0 deletions pkg/store/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ func NewProxyStore(
responseTimeout: responseTimeout,
metrics: metrics,
retrievalStrategy: retrievalStrategy,
labelNamesBloom: bloom.NewAlwaysTrueFilter(),
internalLabelResort: true,
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/store/proxy_heap.go
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@ func hasInternalReplicaLabels(st Client, req *storepb.SeriesRequest, internalLab
bloom := st.LabelNamesBloom()
// Empty bloom filter capacity is 1. We fallback to eager retrieval if bloom filter
// is yet to be updated, as we cannot yet determine if the store has internal replica labels.
if bloom == nil || bloom.Cap() <= 1 {
if bloom.Cap() <= 1 {
return true
}

Expand Down

0 comments on commit a29cc58

Please sign in to comment.