Skip to content

Commit

Permalink
[1.10.x] raft: upgrade to v1.3.6 (#12498)
Browse files Browse the repository at this point in the history
Backport of #12496 to 1.10.x

Conflicts:
- go.mod
  • Loading branch information
rboyer committed Mar 2, 2022
1 parent 00b1f75 commit bf5e6d9
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .changelog/12496.txt
@@ -0,0 +1,3 @@
```release-note:bug
raft: upgrade to v1.3.6 which fixes a bug where a read replica node could attempt bootstrapping raft and prevent other nodes from bootstrapping at all
```
2 changes: 1 addition & 1 deletion agent/consul/server.go
Expand Up @@ -807,7 +807,7 @@ func (s *Server) setupRaft() error {

// If we are in bootstrap or dev mode and the state is clean then we can
// bootstrap now.
if s.config.Bootstrap || s.config.DevMode {
if (s.config.Bootstrap || s.config.DevMode) && !s.config.ReadReplica {
hasState, err := raft.HasExistingState(log, stable, snap)
if err != nil {
return err
Expand Down
5 changes: 5 additions & 0 deletions agent/consul/server_serf.go
Expand Up @@ -334,6 +334,11 @@ func (s *Server) maybeBootstrap() {
return
}

if s.config.ReadReplica {
s.logger.Info("Read replicas cannot bootstrap raft")
return
}

// Scan for all the known servers.
members := s.serfLAN.Members()
var servers []metadata.Server
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -52,7 +52,7 @@ require (
github.com/hashicorp/mdns v1.0.4 // indirect
github.com/hashicorp/memberlist v0.3.1
github.com/hashicorp/net-rpc-msgpackrpc v0.0.0-20151116020338-a14192a58a69
github.com/hashicorp/raft v1.3.5
github.com/hashicorp/raft v1.3.6
github.com/hashicorp/raft-autopilot v0.1.5
github.com/hashicorp/raft-boltdb v0.0.0-20171010151810-6e5ba93211ea
github.com/hashicorp/serf v0.9.5
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Expand Up @@ -285,8 +285,8 @@ github.com/hashicorp/net-rpc-msgpackrpc v0.0.0-20151116020338-a14192a58a69 h1:lc
github.com/hashicorp/net-rpc-msgpackrpc v0.0.0-20151116020338-a14192a58a69/go.mod h1:/z+jUGRBlwVpUZfjute9jWaF6/HuhjuFQuL1YXzVD1Q=
github.com/hashicorp/raft v1.1.1/go.mod h1:vPAJM8Asw6u8LxC3eJCUZmRP/E4QmUGE1R7g7k8sG/8=
github.com/hashicorp/raft v1.2.0/go.mod h1:vPAJM8Asw6u8LxC3eJCUZmRP/E4QmUGE1R7g7k8sG/8=
github.com/hashicorp/raft v1.3.5 h1:93YBXmHWW2MuyMZfMxN1PsAnPXAt+hBfG0S0ZrZxRrY=
github.com/hashicorp/raft v1.3.5/go.mod h1:4Ak7FSPnuvmb0GV6vgIAJ4vYT4bek9bb6Q+7HVbyzqM=
github.com/hashicorp/raft v1.3.6 h1:v5xW5KzByoerQlN/o31VJrFNiozgzGyDoMgDJgXpsto=
github.com/hashicorp/raft v1.3.6/go.mod h1:4Ak7FSPnuvmb0GV6vgIAJ4vYT4bek9bb6Q+7HVbyzqM=
github.com/hashicorp/raft-autopilot v0.1.5 h1:onEfMH5uHVdXQqtas36zXUHEZxLdsJVu/nXHLcLdL1I=
github.com/hashicorp/raft-autopilot v0.1.5/go.mod h1:Af4jZBwaNOI+tXfIqIdbcAnh/UyyqIMj/pOISIfhArw=
github.com/hashicorp/raft-boltdb v0.0.0-20171010151810-6e5ba93211ea h1:xykPFhrBAS2J0VBzVa5e80b5ZtYuNQtgXjN40qBZlD4=
Expand Down
4 changes: 4 additions & 0 deletions vendor/github.com/hashicorp/raft/api.go

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

5 changes: 5 additions & 0 deletions vendor/github.com/hashicorp/raft/raft.go

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

2 changes: 1 addition & 1 deletion vendor/modules.txt
Expand Up @@ -483,7 +483,7 @@ github.com/hashicorp/mdns
github.com/hashicorp/memberlist
# github.com/hashicorp/net-rpc-msgpackrpc v0.0.0-20151116020338-a14192a58a69
github.com/hashicorp/net-rpc-msgpackrpc
# github.com/hashicorp/raft v1.3.5
# github.com/hashicorp/raft v1.3.6
github.com/hashicorp/raft
# github.com/hashicorp/raft-autopilot v0.1.5
github.com/hashicorp/raft-autopilot
Expand Down

0 comments on commit bf5e6d9

Please sign in to comment.