Skip to content

Commit

Permalink
*: update etcd (#1452)
Browse files Browse the repository at this point in the history
  • Loading branch information
nolouch committed Mar 27, 2019
1 parent 5717017 commit 329082d
Show file tree
Hide file tree
Showing 21 changed files with 85 additions and 81 deletions.
29 changes: 5 additions & 24 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,14 @@ go 1.12

require (
github.com/BurntSushi/toml v0.3.1
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 // indirect
github.com/chzyer/logex v1.1.10 // indirect
github.com/chzyer/readline v0.0.0-20171208011716-f6d7a1f6fbf3
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 // indirect
github.com/coreos/bbolt v1.3.1-coreos.6 // indirect
github.com/coreos/etcd v0.0.0-20180530235116-2b3aa7e1d49d
github.com/coreos/go-semver v0.2.0
github.com/coreos/go-systemd v0.0.0-20180202092358-40e2722dffea // indirect
github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect
github.com/dustin/go-humanize v0.0.0-20180421182945-02af3965c54e
github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385 // indirect
github.com/ghodss/yaml v1.0.0
github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32
github.com/gogo/protobuf v1.0.0
github.com/golang/groupcache v0.0.0-20181024230925-c65c006176ff // indirect
github.com/golang/protobuf v1.2.0
Expand All @@ -26,16 +20,11 @@ require (
github.com/gorilla/context v0.0.0-20160226214623-1ea25387ff6f // indirect
github.com/gorilla/mux v1.6.1
github.com/gorilla/websocket v1.2.0 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v0.0.0-20160910222444-6b7015e65d36
github.com/grpc-ecosystem/grpc-gateway v1.4.1 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/jonboulle/clockwork v0.1.0 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
github.com/juju/ratelimit v1.0.1
github.com/kr/pretty v0.1.0 // indirect
github.com/mattn/go-shellwords v1.0.3
github.com/matttproud/golang_protobuf_extensions v1.0.0 // indirect
github.com/montanaflynn/stats v0.0.0-20151014174947-eeaced052adb
github.com/onsi/gomega v1.4.2 // indirect
github.com/opentracing/opentracing-go v1.0.2
github.com/pingcap/check v0.0.0-20190102082844-67f458068fc8
github.com/pingcap/errcode v0.0.0-20180921232412-a1a7271709d9
Expand All @@ -46,24 +35,16 @@ require (
github.com/pkg/errors v0.8.1
github.com/prometheus/client_golang v0.8.0
github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5 // indirect
github.com/prometheus/common v0.0.0-20180426121432-d811d2e9bf89 // indirect
github.com/prometheus/procfs v0.0.0-20180408092902-8b1c2da0d56d // indirect
github.com/sirupsen/logrus v1.0.5
github.com/soheilhy/cmux v0.1.4 // indirect
github.com/spf13/cobra v0.0.2
github.com/spf13/cobra v0.0.3
github.com/spf13/pflag v1.0.1
github.com/syndtr/goleveldb v0.0.0-20180815032940-ae2bd5eed72d
github.com/tmc/grpc-websocket-proxy v0.0.0-20171017195756-830351dc03c6 // indirect
github.com/ugorji/go v1.1.1 // indirect
github.com/unrolled/render v0.0.0-20171102162132-65450fb6b2d3
github.com/urfave/negroni v0.3.0
github.com/xiang90/probing v0.0.0-20160813154853-07dd2e8dfe18 // indirect
go.etcd.io/etcd v0.0.0-20190320044326-77d4b742cdbf
go.uber.org/zap v1.9.1
golang.org/x/crypto v0.0.0-20180503215945-1f94bef427e3 // indirect
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2 // indirect
google.golang.org/grpc v1.12.2
gopkg.in/airbrake/gobrake.v2 v2.0.9 // indirect
google.golang.org/grpc v1.14.0
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0
)
72 changes: 48 additions & 24 deletions go.sum

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions pkg/etcdutil/etcdutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ import (
"net/http"
"time"

"github.com/coreos/etcd/clientv3"
"github.com/coreos/etcd/etcdserver"
"github.com/coreos/etcd/pkg/types"
log "github.com/pingcap/log"
"github.com/pkg/errors"
"go.etcd.io/etcd/clientv3"
"go.etcd.io/etcd/etcdserver"
"go.etcd.io/etcd/pkg/types"
)

const (
Expand Down
6 changes: 3 additions & 3 deletions pkg/etcdutil/etcdutil_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ import (
"os"
"testing"

"github.com/coreos/etcd/clientv3"
"github.com/coreos/etcd/embed"
"github.com/coreos/etcd/pkg/types"
. "github.com/pingcap/check"
"github.com/pingcap/pd/pkg/tempurl"
"go.etcd.io/etcd/clientv3"
"go.etcd.io/etcd/embed"
"go.etcd.io/etcd/pkg/types"
)

func Test(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/logutil/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ import (
"strings"
"sync"

"github.com/coreos/etcd/raft"
"github.com/coreos/pkg/capnslog"
zaplog "github.com/pingcap/log"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
"go.etcd.io/etcd/raft"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"google.golang.org/grpc/grpclog"
Expand Down
2 changes: 1 addition & 1 deletion server/api/utiletcdhttpapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (

const (
//etcd peer detail API
//return struct https://github.com/coreos/etcd/blob/master/etcdserver/stats/server.go
//return struct https://github.com/etcd-io/etcd/blob/024f3dfc820e93e912c4b031b37edc66c5a0d72c/etcdserver/server.go#L1509
etcdPeerStatsAPI = "/v2/stats/self"
)

Expand Down
9 changes: 4 additions & 5 deletions server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ import (
"time"

"github.com/BurntSushi/toml"
"github.com/coreos/etcd/embed"
"github.com/coreos/etcd/pkg/transport"
"github.com/coreos/go-semver/semver"
"github.com/pingcap/log"
"github.com/pingcap/pd/pkg/metricutil"
"github.com/pingcap/pd/pkg/typeutil"
"github.com/pingcap/pd/server/namespace"
"github.com/pingcap/pd/server/schedule"
"github.com/pkg/errors"
"go.etcd.io/etcd/embed"
"go.etcd.io/etcd/pkg/transport"
"go.uber.org/zap"
)

Expand Down Expand Up @@ -832,9 +832,8 @@ func (c *Config) genEmbedEtcdConfig() (*embed.Config, error) {
cfg.PeerTLSInfo.TrustedCAFile = c.Security.CAPath
cfg.PeerTLSInfo.CertFile = c.Security.CertPath
cfg.PeerTLSInfo.KeyFile = c.Security.KeyPath
// TODO: update etcd
// cfg.ZapLoggerBuilder = embed.NewZapCoreLoggerBuilder(c.logger, c.logger.Core(), c.logSyncer)
// cfg.Logger = "zap"
cfg.ZapLoggerBuilder = embed.NewZapCoreLoggerBuilder(c.logger, c.logger.Core(), c.logProps.Syncer)
cfg.Logger = "zap"
var err error

cfg.LPUrls, err = ParseUrls(c.PeerUrls)
Expand Down
2 changes: 1 addition & 1 deletion server/etcd_kv.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import (
"path"
"time"

"github.com/coreos/etcd/clientv3"
log "github.com/pingcap/log"
"github.com/pkg/errors"
"go.etcd.io/etcd/clientv3"
"go.uber.org/zap"
)

Expand Down
2 changes: 1 addition & 1 deletion server/id.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ package server
import (
"sync"

"github.com/coreos/etcd/clientv3"
log "github.com/pingcap/log"
"github.com/pkg/errors"
"go.etcd.io/etcd/clientv3"
"go.uber.org/zap"
)

Expand Down
2 changes: 1 addition & 1 deletion server/id_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import (
"context"
"sync"

"github.com/coreos/etcd/clientv3"
. "github.com/pingcap/check"
"github.com/pingcap/kvproto/pkg/pdpb"
"go.etcd.io/etcd/clientv3"
)

var _ = Suite(&testAllocIDSuite{})
Expand Down
4 changes: 2 additions & 2 deletions server/join.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ import (
"path"
"strings"

"github.com/coreos/etcd/clientv3"
"github.com/coreos/etcd/embed"
log "github.com/pingcap/log"
"github.com/pingcap/pd/pkg/etcdutil"
"github.com/pkg/errors"
"go.etcd.io/etcd/clientv3"
"go.etcd.io/etcd/embed"
"go.uber.org/zap"
)

Expand Down
4 changes: 2 additions & 2 deletions server/leader.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ import (
"strings"
"time"

"github.com/coreos/etcd/clientv3"
"github.com/coreos/etcd/mvcc/mvccpb"
"github.com/pingcap/kvproto/pkg/pdpb"
log "github.com/pingcap/log"
"github.com/pingcap/pd/pkg/etcdutil"
"github.com/pingcap/pd/pkg/logutil"
"github.com/pkg/errors"
"go.etcd.io/etcd/clientv3"
"go.etcd.io/etcd/mvcc/mvccpb"
"go.uber.org/zap"
)

Expand Down
8 changes: 4 additions & 4 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ import (
"sync/atomic"
"time"

"github.com/coreos/etcd/clientv3"
"github.com/coreos/etcd/embed"
"github.com/coreos/etcd/pkg/types"
"github.com/coreos/go-semver/semver"
"github.com/golang/protobuf/proto"
"github.com/pingcap/kvproto/pkg/metapb"
Expand All @@ -39,6 +36,9 @@ import (
"github.com/pingcap/pd/server/core"
"github.com/pingcap/pd/server/namespace"
"github.com/pkg/errors"
"go.etcd.io/etcd/clientv3"
"go.etcd.io/etcd/embed"
"go.etcd.io/etcd/pkg/types"
"go.uber.org/zap"
"google.golang.org/grpc"
)
Expand Down Expand Up @@ -132,7 +132,7 @@ func CreateServer(cfg *Config, apiRegister func(*Server) http.Handler) (*Server,
// The etcd master version has removed embed.Config.SetupLogging.
// Now logger is set up automatically based on embed.Config.Logger,
// Use zap logger in the test, otherwise will panic.
// Reference: https://github.com/coreos/etcd/blob/master/embed/config_logging.go#L45
// Reference: https://go.etcd.io/etcd/blob/master/embed/config_logging.go#L45
s.etcdCfg.Logger = "zap"
s.etcdCfg.LogOutputs = []string{"stdout"}
}
Expand Down
2 changes: 1 addition & 1 deletion server/testutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ import (
"sync"
"time"

"github.com/coreos/etcd/embed"
"github.com/pingcap/check"
"github.com/pingcap/log"
"github.com/pingcap/pd/pkg/tempurl"
"github.com/pingcap/pd/pkg/typeutil"
"go.etcd.io/etcd/embed"

// Register namespace classifiers.
_ "github.com/pingcap/pd/table"
Expand Down
2 changes: 1 addition & 1 deletion server/tso.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ import (
"sync/atomic"
"time"

"github.com/coreos/etcd/clientv3"
"github.com/pingcap/kvproto/pkg/pdpb"
log "github.com/pingcap/log"
"github.com/pkg/errors"
"go.etcd.io/etcd/clientv3"
"go.uber.org/zap"
)

Expand Down
2 changes: 1 addition & 1 deletion server/tso_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ import (
"sync"
"time"

"github.com/coreos/etcd/clientv3"
. "github.com/pingcap/check"
gofail "github.com/pingcap/gofail/runtime"
"github.com/pingcap/kvproto/pkg/pdpb"
"go.etcd.io/etcd/clientv3"
)

var _ = Suite(&testTsoSuite{})
Expand Down
2 changes: 1 addition & 1 deletion server/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ import (
"regexp"
"time"

"github.com/coreos/etcd/clientv3"
"github.com/golang/protobuf/proto"
"github.com/pingcap/kvproto/pkg/metapb"
"github.com/pingcap/kvproto/pkg/pdpb"
log "github.com/pingcap/log"
"github.com/pingcap/pd/pkg/etcdutil"
"github.com/pkg/errors"
"go.etcd.io/etcd/clientv3"
"go.uber.org/zap"
)

Expand Down
2 changes: 1 addition & 1 deletion tests/client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ import (
"testing"
"time"

"github.com/coreos/etcd/clientv3"
. "github.com/pingcap/check"
pd "github.com/pingcap/pd/client"
"github.com/pingcap/pd/pkg/testutil"
"github.com/pingcap/pd/server"
"github.com/pingcap/pd/tests"
"go.etcd.io/etcd/clientv3"
)

func Test(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion tests/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"sync"
"time"

"github.com/coreos/etcd/clientv3"
"github.com/coreos/go-semver/semver"
"github.com/pingcap/kvproto/pkg/metapb"
"github.com/pingcap/kvproto/pkg/pdpb"
Expand All @@ -28,6 +27,7 @@ import (
"github.com/pingcap/pd/server/api"
"github.com/pingcap/pd/server/core"
"github.com/pkg/errors"
"go.etcd.io/etcd/clientv3"
"go.uber.org/zap"
)

Expand Down
2 changes: 1 addition & 1 deletion tools/pd-ctl/pdctl/command/global.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import (
"net/url"
"os"

"github.com/coreos/etcd/pkg/transport"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"go.etcd.io/etcd/pkg/transport"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions tools/pd-recover/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
"strings"
"time"

"github.com/coreos/etcd/clientv3"
"github.com/coreos/etcd/pkg/transport"
"github.com/pingcap/kvproto/pkg/metapb"
"go.etcd.io/etcd/clientv3"
"go.etcd.io/etcd/pkg/transport"
)

var (
Expand Down

0 comments on commit 329082d

Please sign in to comment.