Skip to content

Commit

Permalink
add extension field for client
Browse files Browse the repository at this point in the history
1.Add extension field for client
2.Upgrade versions of libraries such as raft
  • Loading branch information
wind-c committed Mar 14, 2024
1 parent ef19af7 commit ddf550a
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 41 deletions.
14 changes: 7 additions & 7 deletions cluster/raft/hashicorp/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ func Setup(conf *config.Cluster, notifyCh chan<- *message.Message) (*Peer, error
config.LocalID = raft.ServerID(conf.NodeName)
config.LogLevel = "ERROR"
config.LogOutput = log.Writer()
config.ShutdownOnRemove = false // Disable shutdown on removal
config.SnapshotInterval = 30 * time.Second // Check every 5 seconds to see if there are enough new entries for a snapshot, can be overridden
config.SnapshotThreshold = 16384 // Snapshots are created every 16384 entries by default, can be overridden
// config.HeartbeatTimeout = 1000 * time.Millisecond
// config.electionTimeout = 1000 * time.Millisecond
// config.CommitTimeout = 500 * time.Millisecond
// config.LeaderLeaseTimeout = 1000 * time.Millisecond
//config.ShutdownOnRemove = true // Enable shutdown on removal
//config.SnapshotInterval = 30 * time.Second // Check every 30 seconds to see if there are enough new entries for a snapshot, can be overridden
//config.SnapshotThreshold = 16384 // Snapshots are created every 16384 entries by default, can be overridden
//config.HeartbeatTimeout = 1000 * time.Millisecond
//config.electionTimeout = 1000 * time.Millisecond
//config.CommitTimeout = 500 * time.Millisecond
//config.LeaderLeaseTimeout = 1000 * time.Millisecond

var transport raft.Transport
raftAddr := net.JoinHostPort(conf.BindAddr, strconv.Itoa(conf.RaftPort))
Expand Down
18 changes: 10 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ require (
github.com/hashicorp/go-sockaddr v1.0.2
github.com/hashicorp/logutils v1.0.0
github.com/hashicorp/memberlist v0.5.0
github.com/hashicorp/raft v1.5.0
github.com/hashicorp/raft v1.6.0
github.com/hashicorp/raft-boltdb/v2 v2.2.2
github.com/hashicorp/serf v0.10.1
github.com/jinzhu/copier v0.3.5
Expand All @@ -24,16 +24,16 @@ require (
github.com/rs/xid v1.4.0
github.com/satori/go.uuid v1.2.0
github.com/segmentio/kafka-go v0.4.38
github.com/stretchr/testify v1.8.2
github.com/stretchr/testify v1.8.4
github.com/timshannon/badgerhold v1.0.0
github.com/tinylib/msgp v1.1.6
github.com/tinylib/msgp v1.1.8
go.etcd.io/bbolt v1.3.6
go.etcd.io/etcd/client/pkg/v3 v3.5.4
go.etcd.io/etcd/raft/v3 v3.5.4
go.etcd.io/etcd/server/v3 v3.5.4
go.uber.org/goleak v1.2.1
go.uber.org/zap v1.21.0
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d
golang.org/x/crypto v0.14.0
google.golang.org/grpc v1.53.0
gopkg.in/h2non/gock.v1 v1.1.2
gopkg.in/natefinch/lumberjack.v2 v2.0.0
Expand All @@ -43,6 +43,7 @@ require (
require (
github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96 // indirect
github.com/BurntSushi/toml v1.1.0 // indirect
github.com/Sereal/Sereal v0.0.0-20190618215532-0b8ac451a863 // indirect
github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect
github.com/armon/go-metrics v0.4.1 // indirect
github.com/beorn7/perks v1.0.1 // indirect
Expand All @@ -62,6 +63,7 @@ require (
github.com/hashicorp/go-hclog v1.5.0 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-msgpack v1.1.5 // indirect
github.com/hashicorp/go-msgpack/v2 v2.1.1 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/hashicorp/raft-boltdb v0.0.0-20220329195025-15018e9b97e0 // indirect
Expand All @@ -71,7 +73,7 @@ require (
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/miekg/dns v1.1.41 // indirect
github.com/philhofer/fwd v1.1.1 // indirect
github.com/philhofer/fwd v1.1.2 // indirect
github.com/pierrec/lz4/v4 v4.1.15 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
Expand All @@ -86,9 +88,9 @@ require (
go.etcd.io/etcd/pkg/v3 v3.5.4 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
golang.org/x/net v0.6.0 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
golang.org/x/net v0.16.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba // indirect
google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect
google.golang.org/protobuf v1.28.1 // indirect
Expand Down
Loading

0 comments on commit ddf550a

Please sign in to comment.