Update serf

To pick up data race fixes
This commit is contained in:
Daniel Nephin 2021-06-09 17:11:53 -04:00
parent c3c8058fd7
commit 291315e39f
4 changed files with 8 additions and 6 deletions

2
go.mod
View File

@ -55,7 +55,7 @@ require (
github.com/hashicorp/raft v1.3.1 github.com/hashicorp/raft v1.3.1
github.com/hashicorp/raft-autopilot v0.1.5 github.com/hashicorp/raft-autopilot v0.1.5
github.com/hashicorp/raft-boltdb v0.0.0-20171010151810-6e5ba93211ea github.com/hashicorp/raft-boltdb v0.0.0-20171010151810-6e5ba93211ea
github.com/hashicorp/serf v0.9.5 github.com/hashicorp/serf v0.9.6-0.20210609195804-2b5dd0cd2de9
github.com/hashicorp/vault/api v1.0.5-0.20200717191844-f687267c8086 github.com/hashicorp/vault/api v1.0.5-0.20200717191844-f687267c8086
github.com/hashicorp/yamux v0.0.0-20200609203250-aecfd211c9ce github.com/hashicorp/yamux v0.0.0-20200609203250-aecfd211c9ce
github.com/imdario/mergo v0.3.6 github.com/imdario/mergo v0.3.6

3
go.sum
View File

@ -291,8 +291,9 @@ github.com/hashicorp/raft-autopilot v0.1.5 h1:onEfMH5uHVdXQqtas36zXUHEZxLdsJVu/n
github.com/hashicorp/raft-autopilot v0.1.5/go.mod h1:Af4jZBwaNOI+tXfIqIdbcAnh/UyyqIMj/pOISIfhArw= 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= github.com/hashicorp/raft-boltdb v0.0.0-20171010151810-6e5ba93211ea h1:xykPFhrBAS2J0VBzVa5e80b5ZtYuNQtgXjN40qBZlD4=
github.com/hashicorp/raft-boltdb v0.0.0-20171010151810-6e5ba93211ea/go.mod h1:pNv7Wc3ycL6F5oOWn+tPGo2gWD4a5X+yp/ntwdKLjRk= github.com/hashicorp/raft-boltdb v0.0.0-20171010151810-6e5ba93211ea/go.mod h1:pNv7Wc3ycL6F5oOWn+tPGo2gWD4a5X+yp/ntwdKLjRk=
github.com/hashicorp/serf v0.9.5 h1:EBWvyu9tcRszt3Bxp3KNssBMP1KuHWyO51lz9+786iM=
github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk=
github.com/hashicorp/serf v0.9.6-0.20210609195804-2b5dd0cd2de9 h1:lCZfMBDn/Puwg9VosHMf/9p9jNDYYkbzVjb4jYjVfqU=
github.com/hashicorp/serf v0.9.6-0.20210609195804-2b5dd0cd2de9/go.mod h1:qapjppkpNXHYTyzx+HqkyWGGkmUxafHjuspm/Bqb2Jc=
github.com/hashicorp/vault/api v1.0.5-0.20200717191844-f687267c8086 h1:OKsyxKi2sNmqm1Gv93adf2AID2FOBFdCbbZn9fGtIdg= github.com/hashicorp/vault/api v1.0.5-0.20200717191844-f687267c8086 h1:OKsyxKi2sNmqm1Gv93adf2AID2FOBFdCbbZn9fGtIdg=
github.com/hashicorp/vault/api v1.0.5-0.20200717191844-f687267c8086/go.mod h1:R3Umvhlxi2TN7Ex2hzOowyeNb+SfbVWI973N+ctaFMk= github.com/hashicorp/vault/api v1.0.5-0.20200717191844-f687267c8086/go.mod h1:R3Umvhlxi2TN7Ex2hzOowyeNb+SfbVWI973N+ctaFMk=
github.com/hashicorp/vault/sdk v0.1.14-0.20200519221838-e0cfd64bc267 h1:e1ok06zGrWJW91rzRroyl5nRNqraaBe4d5hiKcVZuHM= github.com/hashicorp/vault/sdk v0.1.14-0.20200519221838-e0cfd64bc267 h1:e1ok06zGrWJW91rzRroyl5nRNqraaBe4d5hiKcVZuHM=

View File

@ -958,7 +958,7 @@ func (s *Serf) handleNodeJoin(n *memberlist.Node) {
member.Status = StatusAlive member.Status = StatusAlive
member.leaveTime = time.Time{} member.leaveTime = time.Time{}
member.Addr = net.IP(n.Addr) member.Addr = n.Addr
member.Port = n.Port member.Port = n.Port
member.Tags = s.decodeTags(n.Meta) member.Tags = s.decodeTags(n.Meta)
} }
@ -1088,6 +1088,7 @@ func (s *Serf) handleNodeUpdate(n *memberlist.Node) {
// handleNodeLeaveIntent is called when an intent to leave is received. // handleNodeLeaveIntent is called when an intent to leave is received.
func (s *Serf) handleNodeLeaveIntent(leaveMsg *messageLeave) bool { func (s *Serf) handleNodeLeaveIntent(leaveMsg *messageLeave) bool {
state := s.State()
// Witness a potentially newer time // Witness a potentially newer time
s.clock.Witness(leaveMsg.LTime) s.clock.Witness(leaveMsg.LTime)
@ -1108,7 +1109,7 @@ func (s *Serf) handleNodeLeaveIntent(leaveMsg *messageLeave) bool {
// Refute us leaving if we are in the alive state // Refute us leaving if we are in the alive state
// Must be done in another goroutine since we have the memberLock // Must be done in another goroutine since we have the memberLock
if leaveMsg.Node == s.config.NodeName && s.state == SerfAlive { if leaveMsg.Node == s.config.NodeName && state == SerfAlive {
s.logger.Printf("[DEBUG] serf: Refuting an older leave intent") s.logger.Printf("[DEBUG] serf: Refuting an older leave intent")
go s.broadcastJoin(s.clock.Time()) go s.broadcastJoin(s.clock.Time())
return false return false
@ -1639,7 +1640,6 @@ func (s *Serf) reconnect() {
// Select a random member to try and join // Select a random member to try and join
idx := rand.Int31n(int32(n)) idx := rand.Int31n(int32(n))
mem := s.failedMembers[idx] mem := s.failedMembers[idx]
s.memberLock.RUnlock()
// Format the addr // Format the addr
addr := net.UDPAddr{IP: mem.Addr, Port: int(mem.Port)} addr := net.UDPAddr{IP: mem.Addr, Port: int(mem.Port)}
@ -1649,6 +1649,7 @@ func (s *Serf) reconnect() {
if mem.Name != "" { if mem.Name != "" {
joinAddr = mem.Name + "/" + addr.String() joinAddr = mem.Name + "/" + addr.String()
} }
s.memberLock.RUnlock()
// Attempt to join at the memberlist level // Attempt to join at the memberlist level
s.memberlist.Join([]string{joinAddr}) s.memberlist.Join([]string{joinAddr})

2
vendor/modules.txt vendored
View File

@ -489,7 +489,7 @@ github.com/hashicorp/raft
github.com/hashicorp/raft-autopilot github.com/hashicorp/raft-autopilot
# github.com/hashicorp/raft-boltdb v0.0.0-20171010151810-6e5ba93211ea # github.com/hashicorp/raft-boltdb v0.0.0-20171010151810-6e5ba93211ea
github.com/hashicorp/raft-boltdb github.com/hashicorp/raft-boltdb
# github.com/hashicorp/serf v0.9.5 # github.com/hashicorp/serf v0.9.6-0.20210609195804-2b5dd0cd2de9
github.com/hashicorp/serf/coordinate github.com/hashicorp/serf/coordinate
github.com/hashicorp/serf/serf github.com/hashicorp/serf/serf
# github.com/hashicorp/vault/api v1.0.5-0.20200717191844-f687267c8086 # github.com/hashicorp/vault/api v1.0.5-0.20200717191844-f687267c8086