Skip to content

Commit

Permalink
Fix labelset race condition (#6573)
Browse files Browse the repository at this point in the history
Signed-off-by: SungJin1212 <[email protected]>
  • Loading branch information
SungJin1212 authored Feb 4, 2025
1 parent 8accaa9 commit c05fe0b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* [ENHANCEMENT] Querier: Apply bytes limiter to LabelNames and LabelValuesForLabelNames. #6568
* [ENHANCEMENT] Query Frontend: Add a `too_many_tenants` reason label value to `cortex_rejected_queries_total` metric to track the rejected query count due to the # of tenant limits. #6569
* [BUGFIX] Ingester: Avoid error or early throttling when READONLY ingesters are present in the ring #6517
* [BUGFIX] Ingester: Fix labelset data race condition. #6573

## 1.19.0 in progress

Expand Down
3 changes: 1 addition & 2 deletions pkg/ingester/user_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,14 @@ func (m *labelSetCounter) canAddSeriesForLabelSet(ctx context.Context, u *userTS

func (m *labelSetCounter) backFillLimit(ctx context.Context, u *userTSDB, forceBackfill bool, allLimits []validation.LimitsPerLabelSet, limit validation.LimitsPerLabelSet, s *labelSetCounterShard) (int, error) {
s.Lock()
defer s.Unlock()
// If not force backfill, use existing counter value.
if !forceBackfill {
if r, ok := s.valuesCounter[limit.Hash]; ok {
s.Unlock()
return r.count, nil
}
}

defer s.Unlock()
ir, err := u.db.Head().Index()
if err != nil {
return 0, err
Expand Down

0 comments on commit c05fe0b

Please sign in to comment.