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

[etcd] Upgrade etcd client library to 3.4.3 to fix data race in tests #2101

Merged
merged 7 commits into from
Jan 12, 2020
Merged
Show file tree
Hide file tree
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
22 changes: 11 additions & 11 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ common: &common

steps:
- name: "Codegen"
command: make clean install-vendor test-all-gen
command: make clean install-vendor-m3 test-all-gen
env:
CGO_ENABLED: 0
GIMME_GO_VERSION: 1.12.x
Expand All @@ -20,30 +20,30 @@ steps:
import: github.com/m3db/m3
<<: *common
- name: "Unit %n"
command: make clean install-vendor test-ci-unit
command: make clean install-vendor-m3 test-ci-unit
parallelism: 4
plugins:
docker-compose#v2.5.1:
run: app
workdir: /go/src/github.com/m3db/m3
<<: *common
- name: "Big Unit %n"
command: make clean install-vendor test-ci-big-unit
command: make clean install-vendor-m3 test-ci-big-unit
parallelism: 2
plugins:
docker-compose#v2.5.1:
run: app
workdir: /go/src/github.com/m3db/m3
<<: *common
- name: "Services, Tools, Metalint"
command: make clean install-vendor services tools metalint
command: make clean install-vendor-m3 services tools metalint
plugins:
docker-compose#v2.5.1:
run: app
workdir: /go/src/github.com/m3db/m3
<<: *common
- name: "Integration (:docker:)"
command: make clean install-vendor docker-integration-test
command: make clean install-vendor-m3 docker-integration-test
parallelism: 2
env:
CGO_ENABLED: 0
Expand All @@ -53,7 +53,7 @@ steps:
import: github.com/m3db/m3
<<: *common
- name: "Prometheus compatibility (:docker:)"
command: make clean install-vendor docker-compatibility-test
command: make clean install-vendor-m3 docker-compatibility-test
parallelism: 1
env:
CGO_ENABLED: 0
Expand All @@ -64,30 +64,30 @@ steps:
<<: *common
- name: "Integration (dbnode Recently Read) %n"
parallelism: 2
command: make clean install-vendor test-ci-integration-dbnode cache_policy=recently_read
command: make clean install-vendor-m3 test-ci-integration-dbnode cache_policy=recently_read
plugins:
docker-compose#v2.5.1:
run: app
workdir: /go/src/github.com/m3db/m3
<<: *common
- name: "Integration (dbnode LRU) %n"
parallelism: 2
command: make clean install-vendor test-ci-integration-dbnode cache_policy=lru
command: make clean install-vendor-m3 test-ci-integration-dbnode cache_policy=lru
plugins:
docker-compose#v2.5.1:
run: app
workdir: /go/src/github.com/m3db/m3
<<: *common
- label: "Integration (collector, aggregator, m3em, cluster, msg, metrics) %n"
parallelism: 4
command: make clean install-vendor test-ci-integration-collector test-ci-integration-aggregator test-ci-integration-m3em test-ci-integration-cluster test-ci-integration-msg test-ci-integration-metrics
command: make clean install-vendor-m3 test-ci-integration-collector test-ci-integration-aggregator test-ci-integration-m3em test-ci-integration-cluster test-ci-integration-msg test-ci-integration-metrics
plugins:
docker-compose#v2.5.1:
run: app
workdir: /go/src/github.com/m3db/m3
<<: *common
- name: "Documentation tests"
command: make clean install-vendor docs-test
command: make clean install-vendor-m3 docs-test
env:
CGO_ENABLED: 0
GIMME_GO_VERSION: 1.12.x
Expand All @@ -96,7 +96,7 @@ steps:
import: github.com/m3db/m3
<<: *common
- label: "FOSSA license scan"
command: make clean install-vendor fossa
command: make clean install-vendor-m3 fossa
plugins:
docker-compose#v2.5.1:
run: app
Expand Down
42 changes: 38 additions & 4 deletions .fossa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,42 @@ analyze:
type: go
target: github.com/m3db/m3/scripts/lockfile
path: scripts/lockfile
options:
# FOSSA finds Go dependencies by first finding all dependencies that a project uses and then comparing them to the lockfile to obtain version numbers.
# It appears that one of the dependencies is choosing to manually vendor a dependency, thereby omitting the version from its lockfile.
# This results in cryptic FOSSA failures.
# The solution for this is to allow this dependency to be discovered without a corresponding version.
allow-unresolved: true
- name: github.com/m3db/m3/scripts/md5
type: go
target: github.com/m3db/m3/scripts/md5
path: scripts/md5
options:
allow-unresolved: true
- name: github.com/m3db/m3/src/cmd/services/m3aggregator/main
type: go
target: github.com/m3db/m3/src/cmd/services/m3aggregator/main
path: src/cmd/services/m3aggregator/main
options:
allow-unresolved: true
- name: github.com/m3db/m3/src/cmd/services/m3collector/main
type: go
target: github.com/m3db/m3/src/cmd/services/m3collector/main
path: src/cmd/services/m3collector/main
options:
allow-unresolved: true
- name: github.com/m3db/m3/src/cmd/services/m3coordinator/main
type: go
target: github.com/m3db/m3/src/cmd/services/m3coordinator/main
path: src/cmd/services/m3coordinator/main
options:
# FOSSA finds Go dependencies by first finding all dependencies that a project uses and then comparing them to the lockfile to obtain version numbers.
# It appears that one of the dependencies is choosing to manually vendor a dependency, thereby omitting the version from its lockfile.
# This results in cryptic FOSSA failures.
# The solution for this is to allow this dependency to be discovered without a corresponding version.
allow-unresolved: true
- name: github.com/m3db/m3/src/cmd/services/m3ctl/main
type: go
target: github.com/m3db/m3/src/cmd/services/m3ctl/main
path: src/cmd/services/m3ctl/main
options:
allow-unresolved: true
- name: github.com/m3db/m3/src/cmd/services/m3dbnode/main
type: go
target: github.com/m3db/m3/src/cmd/services/m3dbnode/main
Expand All @@ -48,14 +58,20 @@ analyze:
type: go
target: github.com/m3db/m3/src/cmd/services/m3em_agent/main
path: src/cmd/services/m3em_agent/main
options:
allow-unresolved: true
- name: github.com/m3db/m3/src/cmd/services/m3nsch_client/main
type: go
target: github.com/m3db/m3/src/cmd/services/m3nsch_client/main
path: src/cmd/services/m3nsch_client/main
options:
allow-unresolved: true
- name: github.com/m3db/m3/src/cmd/services/m3nsch_server/main
type: go
target: github.com/m3db/m3/src/cmd/services/m3nsch_server/main
path: src/cmd/services/m3nsch_server/main
options:
allow-unresolved: true
- name: github.com/m3db/m3/src/cmd/services/m3query/main
type: go
target: github.com/m3db/m3/src/cmd/services/m3query/main
Expand All @@ -66,35 +82,53 @@ analyze:
type: go
target: github.com/m3db/m3/src/cmd/services/m3comparator/main
path: src/cmd/services/m3comparator/main
options:
allow-unresolved: true
- name: github.com/m3db/m3/src/cmd/tools/carbon_load/main
type: go
target: github.com/m3db/m3/src/cmd/tools/carbon_load/main
path: src/cmd/tools/carbon_load/main
options:
allow-unresolved: true
- name: github.com/m3db/m3/src/cmd/tools/clone_fileset/main
type: go
target: github.com/m3db/m3/src/cmd/tools/clone_fileset/main
path: src/cmd/tools/clone_fileset/main
options:
allow-unresolved: true
- name: github.com/m3db/m3/src/cmd/tools/read_data_files/main
type: go
target: github.com/m3db/m3/src/cmd/tools/read_data_files/main
path: src/cmd/tools/read_data_files/main
options:
allow-unresolved: true
- name: github.com/m3db/m3/src/cmd/tools/read_ids/main
type: go
target: github.com/m3db/m3/src/cmd/tools/read_ids/main
path: src/cmd/tools/read_ids/main
options:
allow-unresolved: true
- name: github.com/m3db/m3/src/cmd/tools/read_index_files/main
type: go
target: github.com/m3db/m3/src/cmd/tools/read_index_files/main
path: src/cmd/tools/read_index_files/main
options:
allow-unresolved: true
- name: github.com/m3db/m3/src/cmd/tools/read_index_ids/main
type: go
target: github.com/m3db/m3/src/cmd/tools/read_index_ids/main
path: src/cmd/tools/read_index_ids/main
options:
allow-unresolved: true
- name: github.com/m3db/m3/src/cmd/tools/verify_data_files/main
type: go
target: github.com/m3db/m3/src/cmd/tools/verify_data_files/main
path: src/cmd/tools/verify_data_files/main
options:
allow-unresolved: true
- name: github.com/m3db/m3/src/cmd/tools/verify_index_files/main
type: go
target: github.com/m3db/m3/src/cmd/tools/verify_index_files/main
path: src/cmd/tools/verify_index_files/main
options:
allow-unresolved: true
2 changes: 1 addition & 1 deletion DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Install dependencies:
```bash
cd $working_dir/m3

make install-vendor
make install-vendor-m3
```

If everything is setup correctly you should be able to build `m3dbnode`:
Expand Down
21 changes: 20 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ assets_rules_dir := generated/assets
thrift_output_dir := generated/thrift/rpc
thrift_rules_dir := generated/thrift
vendor_prefix := vendor
bad_trace_dep := go.etcd.io/etcd/vendor/golang.org/x/net/trace
cache_policy ?= recently_read
genny_target ?= genny-all

Expand Down Expand Up @@ -98,6 +99,24 @@ TOOLS := \
setup:
mkdir -p $(BUILD)

.PHONY: install-vendor-m3
install-vendor-m3:
[ -d $(VENDOR) ] || make install-vendor

# Some deps were causing panics when using GRPC and etcd libraries were used.
# See issue: https://github.com/etcd-io/etcd/issues/9357
# $ go test -v
# panic: /debug/requests is already registered. You may have two independent
# copies of golang.org/x/net/trace in your binary, trying to maintain separate
# state. This may involve a vendored copy of golang.org/x/net/trace.
#
# goroutine 1 [running]:
# github.com/m3db/m3/vendor/go.etcd.io/etcd/vendor/golang.org/x/net/trace.init.0()
# /Users/r/go/src/github.com/m3db/m3/vendor/go.etcd.io/etcd/vendor/golang.org/x/net/trace/trace.go:123 +0x1cd
# exit status 2
# FAIL github.com/m3db/m3/src/query/remote 0.024s
([ -d $(VENDOR)/$(bad_trace_dep) ] && rm -rf $(VENDOR)/$(bad_trace_dep)) || (echo "No bad trace dep" > /dev/null)

define SERVICE_RULES

.PHONY: $(SERVICE)
Expand All @@ -107,7 +126,7 @@ ifeq ($(SERVICE),m3ctl)
make build-ui-ctl-statik-gen
endif
@echo Building $(SERVICE)
[ -d $(VENDOR) ] || make install-vendor
[ -d $(VENDOR) ] || make install-vendor-m3
$(GO_BUILD_COMMON_ENV) go build -ldflags '$(GO_BUILD_LDFLAGS)' -o $(BUILD)/$(SERVICE) ./src/cmd/services/$(SERVICE)/main/.

.PHONY: $(SERVICE)-linux-amd64
Expand Down
2 changes: 1 addition & 1 deletion docs/m3db/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ The project has also has optimized for the storage and retrieval of float64 valu

[gorilla]: http://www.vldb.org/pvldb/vol8/p1816-teller.pdf
[cassandra]: http://cassandra.apache.org/
[etcd]: https://github.com/coreos/etcd
[etcd]: https://github.com/etcd-io/etcd
[ubeross]: http://uber.github.io
4 changes: 2 additions & 2 deletions glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions glide.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import:
- package: github.com/cespare/xxhash
version: 48099fad606eafc26e3a569fad19ff510fff4df6

- package: github.com/coreos/etcd
version: 3.2.28
- package: go.etcd.io/etcd
version: 3.4.3

- package: github.com/pkg/errors
version: ^0.8
Expand Down
2 changes: 1 addition & 1 deletion kube/bundle.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion kube/etcd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ spec:
spec:
containers:
- name: etcd
image: quay.io/coreos/etcd:v3.3.3
image: quay.io/coreos/etcd:v3.4.3
command:
- "etcd"
- "--name"
Expand Down
2 changes: 1 addition & 1 deletion kube/terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ resource "kubernetes_stateful_set" "etcd_stateful_set" {
spec {
container {
name = "etcd"
image = "quay.io/coreos/etcd:v3.3.3"
image = "quay.io/coreos/etcd:v3.4.3"
command = ["etcd", "--name", "$(MY_POD_NAME)", "--listen-peer-urls", "http://$(MY_IP):2380", "--listen-client-urls", "http://$(MY_IP):2379,http://127.0.0.1:2379", "--advertise-client-urls", "http://$(MY_POD_NAME).etcd:2379", "--initial-cluster-token", "etcd-cluster-1", "--initial-advertise-peer-urls", "http://$(MY_POD_NAME).etcd:2380", "--initial-cluster", "etcd-0=http://etcd-0.etcd:2380,etcd-1=http://etcd-1.etcd:2380,etcd-2=http://etcd-2.etcd:2380", "--initial-cluster-state", "new", "--data-dir", "/var/lib/etcd"]
port {
name = "client"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ services:
- "0.0.0.0:2379-2380:2379-2380"
networks:
- backend
image: quay.io/coreos/etcd:v3.3.10
image: quay.io/coreos/etcd:v3.4.3
command:
- "etcd"
- "--name"
Expand Down
4 changes: 2 additions & 2 deletions src/aggregator/integration/election.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import (
"github.com/m3db/m3/src/cluster/services"
"github.com/m3db/m3/src/cluster/services/leader"

"github.com/coreos/etcd/clientv3"
"github.com/coreos/etcd/integration"
"go.etcd.io/etcd/clientv3"
"go.etcd.io/etcd/integration"
"github.com/stretchr/testify/require"
)

Expand Down
2 changes: 1 addition & 1 deletion src/cluster/client/etcd/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import (
"github.com/m3db/m3/src/x/instrument"
"github.com/m3db/m3/src/x/retry"

"github.com/coreos/etcd/clientv3"
"go.etcd.io/etcd/clientv3"
"github.com/uber-go/tally"
"go.uber.org/zap"
)
Expand Down
4 changes: 2 additions & 2 deletions src/cluster/client/etcd/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import (
"github.com/m3db/m3/src/cluster/kv"
"github.com/m3db/m3/src/cluster/services"

"github.com/coreos/etcd/clientv3"
"github.com/coreos/etcd/integration"
"go.etcd.io/etcd/clientv3"
"go.etcd.io/etcd/integration"
"github.com/stretchr/testify/require"
)

Expand Down
4 changes: 2 additions & 2 deletions src/cluster/etcd/watchmanager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import (
"fmt"
"time"

"github.com/coreos/etcd/clientv3"
"github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes"
"go.etcd.io/etcd/clientv3"
"go.etcd.io/etcd/etcdserver/api/v3rpc/rpctypes"
"github.com/uber-go/tally"
"go.uber.org/zap"
)
Expand Down
4 changes: 2 additions & 2 deletions src/cluster/etcd/watchmanager/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import (

"github.com/m3db/m3/src/cluster/mocks"

"github.com/coreos/etcd/clientv3"
"github.com/coreos/etcd/integration"
"go.etcd.io/etcd/clientv3"
"go.etcd.io/etcd/integration"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/uber-go/tally"
Expand Down
2 changes: 1 addition & 1 deletion src/cluster/etcd/watchmanager/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (

"github.com/m3db/m3/src/x/instrument"

"github.com/coreos/etcd/clientv3"
"go.etcd.io/etcd/clientv3"
)

const (
Expand Down
Loading