From 2c1a58ee1330ab48ce09058620b383e7c3a60906 Mon Sep 17 00:00:00 2001 From: Frederic Branczyk Date: Tue, 9 Jul 2019 10:09:39 +0200 Subject: [PATCH 1/3] *: cut v2.11.0 Signed-off-by: Frederic Branczyk --- CHANGELOG.md | 2 +- VERSION | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb932a3495..56a5583f8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 2.11.0-rc.0 / 2019-07-04 +## 2.11.0 / 2019-07-09 * [CHANGE] Remove `max_retries` from queue_config (it has been unused since rewriting remote-write to utilize the write-ahead-log). #5649 * [CHANGE] The meta file `BlockStats` no longer holds size information. This is now dynamically calculated and kept in memory. It also includes the meta file size which was not included before. tsdb#637 diff --git a/VERSION b/VERSION index ed612dd65c..46b81d815a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.11.0-rc.0 +2.11.0 From 8873e49a452c440f7c92fa72668e9e46f151e492 Mon Sep 17 00:00:00 2001 From: Ye Ji Date: Tue, 9 Jul 2019 16:18:30 -0400 Subject: [PATCH 2/3] give each tree cache its unique channel to avoid multiple close on the same channel Signed-off-by: Ye Ji --- discovery/zookeeper/zookeeper.go | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/discovery/zookeeper/zookeeper.go b/discovery/zookeeper/zookeeper.go index ee27857219..019af105f3 100644 --- a/discovery/zookeeper/zookeeper.go +++ b/discovery/zookeeper/zookeeper.go @@ -108,8 +108,9 @@ type Discovery struct { sources map[string]*targetgroup.Group - updates chan treecache.ZookeeperTreeCacheEvent - treeCaches []*treecache.ZookeeperTreeCache + updates chan treecache.ZookeeperTreeCacheEvent + pathUpdates []chan treecache.ZookeeperTreeCacheEvent + treeCaches []*treecache.ZookeeperTreeCache parse func(data []byte, path string) (model.LabelSet, error) logger log.Logger @@ -155,7 +156,9 @@ func NewDiscovery( logger: logger, } for _, path := range paths { - sd.treeCaches = append(sd.treeCaches, treecache.NewZookeeperTreeCache(conn, path, updates, logger)) + pathUpdate := make(chan treecache.ZookeeperTreeCacheEvent) + sd.pathUpdates = append(sd.pathUpdates, pathUpdate) + sd.treeCaches = append(sd.treeCaches, treecache.NewZookeeperTreeCache(conn, path, pathUpdate, logger)) } return sd, nil } @@ -166,12 +169,26 @@ func (d *Discovery) Run(ctx context.Context, ch chan<- []*targetgroup.Group) { for _, tc := range d.treeCaches { tc.Stop() } - // Drain event channel in case the treecache leaks goroutines otherwise. - for range d.updates { + for _, pathUpdate := range d.pathUpdates { + // Drain event channel in case the treecache leaks goroutines otherwise. + for range pathUpdate { + } } d.conn.Close() }() + for _, pathUpdate := range d.pathUpdates { + go func(update chan treecache.ZookeeperTreeCacheEvent) { + for event := range update { + select { + case d.updates <- event: + case <-ctx.Done(): + return + } + } + }(pathUpdate) + } + for { select { case <-ctx.Done(): From aea611afedc2194a7f018f303d96a8a3f0fd8552 Mon Sep 17 00:00:00 2001 From: Frederic Branczyk Date: Wed, 10 Jul 2019 14:11:02 +0200 Subject: [PATCH 3/3] *: Cut v2.11.1 Signed-off-by: Frederic Branczyk --- CHANGELOG.md | 4 ++++ VERSION | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 56a5583f8b..572872fc7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.11.1 / 2019-07-10 + +* [BUGFIX] Fix potential panic when prometheus is watching multiple zookeeper paths. #5749 + ## 2.11.0 / 2019-07-09 * [CHANGE] Remove `max_retries` from queue_config (it has been unused since rewriting remote-write to utilize the write-ahead-log). #5649 diff --git a/VERSION b/VERSION index 46b81d815a..6ceb272eec 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.11.0 +2.11.1