Skip to content

Commit

Permalink
Release 0.10.0-rc.1 (#1981)
Browse files Browse the repository at this point in the history
* Fixed crash in the memcached servers selector when there's only 1 server (#1975)

* Fixed crash in the memcached servers selector when there's only 1 server

Signed-off-by: Marco Pracucci <[email protected]>

* Updated changelog

Signed-off-by: Marco Pracucci <[email protected]>

* Assert expected error in tests

Signed-off-by: Marco Pracucci <[email protected]>

* *: update everything for 0.10.0-rc.1

Update the version strings before the `0.10.0-rc.1` release.

Signed-off-by: Giedrius Statkevičius <[email protected]>

Co-authored-by: Marco Pracucci <[email protected]>
  • Loading branch information
GiedriusS and pracucci authored Jan 10, 2020
1 parent bfd65e2 commit c45e52d
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 9 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ NOTE: As semantic versioning states all 0.y.z releases can contain breaking chan

We use *breaking* word for marking changes that are not backward compatible (relates only to v0.y.z releases.)

## [v0.10.0-rc.0](https://github.com/thanos-io/thanos/releases/tag/v0.10.0-rc.0) - 2020.01.08
## [v0.10.0-rc.1](https://github.com/thanos-io/thanos/releases/tag/v0.10.0-rc.1) - 2020.01.10

### Fixed

Expand All @@ -29,6 +29,7 @@ Compactor now properly handles partial block uploads for all operation like rete
- [#1872](https://github.com/thanos-io/thanos/pull/1872) Ruler: `/api/v1/rules` now shows a properly formatted value
- [#1945](https://github.com/thanos-io/thanos/pull/1945) `master` container images are now built with Go 1.13
- [#1956](https://github.com/thanos-io/thanos/pull/1956) Ruler: now properly ignores duplicated query addresses
- [#1975](https://github.com/thanos-io/thanos/pull/1975) Store Gateway: fixed panic caused by memcached servers selector when there's 1 memcached node

### Added

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.10.0-rc.0
0.10.0-rc.1
5 changes: 4 additions & 1 deletion pkg/cacheutil/memcached_server_selector.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,12 @@ func (s *MemcachedJumpHashSelector) PickServer(key string) (net.Addr, error) {
return nil, memcache.ErrNoServers
}
if len(addrs) == 1 {
picked := addrs[0]

addrs = (addrs)[:0]
addrsPool.Put(&addrs)
return (addrs)[0], nil

return picked, nil
}

// Pick a server using the jump hash.
Expand Down
48 changes: 48 additions & 0 deletions pkg/cacheutil/memcached_server_selector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,54 @@ func TestNatSort(t *testing.T) {
testutil.Equals(t, expected, input)
}

func TestMemcachedJumpHashSelector_PickServer(t *testing.T) {
defer leaktest.CheckTimeout(t, 10*time.Second)()

tests := []struct {
addrs []string
key string
expectedAddr string
expectedErr error
}{
{
addrs: []string{},
key: "test-1",
expectedErr: memcache.ErrNoServers,
},
{
addrs: []string{"127.0.0.1:11211"},
key: "test-1",
expectedAddr: "127.0.0.1:11211",
},
{
addrs: []string{"127.0.0.1:11211", "127.0.0.2:11211"},
key: "test-1",
expectedAddr: "127.0.0.1:11211",
},
{
addrs: []string{"127.0.0.1:11211", "127.0.0.2:11211"},
key: "test-2",
expectedAddr: "127.0.0.2:11211",
},
}

s := MemcachedJumpHashSelector{}

for _, test := range tests {
testutil.Ok(t, s.SetServers(test.addrs...))

actualAddr, err := s.PickServer(test.key)

if test.expectedErr != nil {
testutil.Equals(t, test.expectedErr, err)
testutil.Equals(t, nil, actualAddr)
} else {
testutil.Ok(t, err)
testutil.Equals(t, test.expectedAddr, actualAddr.String())
}
}
}

func TestMemcachedJumpHashSelector_Each_ShouldRespectServersOrdering(t *testing.T) {
defer leaktest.CheckTimeout(t, 10*time.Second)()

Expand Down
2 changes: 1 addition & 1 deletion tutorials/katacoda/thanos/1-globalview/courseBase.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash

docker pull quay.io/prometheus/prometheus:v2.14.0
docker pull quay.io/thanos/thanos:v0.10.0-rc.0
docker pull quay.io/thanos/thanos:v0.10.0-rc.1
8 changes: 4 additions & 4 deletions tutorials/katacoda/thanos/1-globalview/step2.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ component and can be invoked in a single command.
Let's take a look at all the Thanos commands:

```
docker run --rm quay.io/thanos/thanos:v0.10.0-rc.0 --help
docker run --rm quay.io/thanos/thanos:v0.10.0-rc.1 --help
```{{execute}}
You should see multiple commands that solves different purposes.
Expand Down Expand Up @@ -53,7 +53,7 @@ docker run -d --net=host --rm \
-v $(pwd)/prometheus0_eu1.yml:/etc/prometheus/prometheus.yml \
--name prometheus-0-sidecar-eu1 \
-u root \
quay.io/thanos/thanos:v0.10.0-rc.0 \
quay.io/thanos/thanos:v0.10.0-rc.1 \
sidecar \
--http-address 0.0.0.0:19090 \
--grpc-address 0.0.0.0:19190 \
Expand All @@ -68,7 +68,7 @@ docker run -d --net=host --rm \
-v $(pwd)/prometheus0_us1.yml:/etc/prometheus/prometheus.yml \
--name prometheus-0-sidecar-us1 \
-u root \
quay.io/thanos/thanos:v0.10.0-rc.0 \
quay.io/thanos/thanos:v0.10.0-rc.1 \
sidecar \
--http-address 0.0.0.0:19091 \
--grpc-address 0.0.0.0:19191 \
Expand All @@ -81,7 +81,7 @@ docker run -d --net=host --rm \
-v $(pwd)/prometheus1_us1.yml:/etc/prometheus/prometheus.yml \
--name prometheus-1-sidecar-us1 \
-u root \
quay.io/thanos/thanos:v0.10.0-rc.0 \
quay.io/thanos/thanos:v0.10.0-rc.1 \
sidecar \
--http-address 0.0.0.0:19092 \
--grpc-address 0.0.0.0:19192 \
Expand Down
2 changes: 1 addition & 1 deletion tutorials/katacoda/thanos/1-globalview/step3.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Click below snippet to start the Querier.
```
docker run -d --net=host --rm \
--name querier \
quay.io/thanos/thanos:v0.10.0-rc.0 \
quay.io/thanos/thanos:v0.10.0-rc.1 \
query \
--http-address 0.0.0.0:29090 \
--query.replica-label replica \
Expand Down

0 comments on commit c45e52d

Please sign in to comment.