Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

query: Check duplicate external labels for all stores include existed store #1157

Merged
merged 1 commit into from
May 21, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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