Skip to content

Commit

Permalink
Check duplicate external labels for all stores included existed store (
Browse files Browse the repository at this point in the history
…#1157)

When we change the external labels after store has already joined into
storesets that will makes the external labels duplicated

Check duplicate external labels before checking whether the store is exist or not
  • Loading branch information
godliness authored and bwplotka committed May 21, 2019
1 parent d7e0994 commit 96d7194
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/query/storeset.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,6 @@ func (s *StoreSet) Update(ctx context.Context) {

// Add stores that are not yet in s.stores.
for addr, store := range healthyStores {
if _, ok := s.stores[addr]; ok {
s.updateStoreStatus(store, nil)
continue
}

// Check if it has some external labels specified.
// No external labels means strictly store gateway or ruler and it is fine to have access to multiple instances of them.
//
Expand All @@ -252,6 +247,11 @@ func (s *StoreSet) Update(ctx context.Context) {
continue
}

if _, ok := s.stores[addr]; ok {
s.updateStoreStatus(store, nil)
continue
}

s.stores[addr] = store
s.updateStoreStatus(store, nil)
level.Info(s.logger).Log("msg", "adding new store to query storeset", "address", addr)
Expand Down

0 comments on commit 96d7194

Please sign in to comment.