Skip to content

Commit

Permalink
ui: fix store never removed from /stores page bug
Browse files Browse the repository at this point in the history
We need to update `LastCheck` only if the error is non-nil. That field
is used in the cleanup function to know when to remove the StoreAPI from
the UI. If we always update it, even if an error has happened, that
means that `--store.unhealthy-timeout` is never respected.

Signed-off-by: Giedrius Statkevičius <giedriuswork@gmail.com>
  • Loading branch information
GiedriusS committed Mar 29, 2020
1 parent 4e5c2f2 commit c6cd944
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 73 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ We use *breaking* word for marking changes that are not backward compatible (rel
- [#2231](https://github.com/thanos-io/thanos/pull/2231) Bucket Web - Sort chunks by thanos.downsample.resolution for better grouping
- [#2254](https://github.com/thanos-io/thanos/pull/2254) Bucket: Fix metrics registered multiple times in bucket replicate
- [#2271](https://github.com/thanos-io/thanos/pull/2271) Bucket Web: Fixed Issue #2260 bucket passes null when storage is empty
- [#2339](https://github.com/thanos-io/thanos/pull/2339) Query: fix a bug where `--store.unhealthy-timeout` was never respected

### Added

Expand Down
3 changes: 1 addition & 2 deletions pkg/query/storeset.go
Original file line number Diff line number Diff line change
Expand Up @@ -457,10 +457,9 @@ func (s *StoreSet) updateStoreStatus(store *storeRef, err error) {
}

status.LastError = err
status.LastCheck = time.Now()

if err == nil {

status.LastCheck = time.Now()
mint, maxt := store.TimeRange()
status.LabelSets = store.LabelSets()
status.StoreType = store.StoreType()
Expand Down
Loading

0 comments on commit c6cd944

Please sign in to comment.