-
Notifications
You must be signed in to change notification settings - Fork 443
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
resetNodes() should respect gossip to dead #106
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small change, then this looks good to merge!
state_test.go
Outdated
@@ -862,13 +862,26 @@ func TestMemberList_ResetNodes(t *testing.T) { | |||
d := dead{Node: "test2", Incarnation: 1} | |||
m.deadNode(&d) | |||
|
|||
oldGossipToTheDeadTime := m.config.GossipToTheDeadTime |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to save and restore this - the scope here is just this one test.
state_test.go
Outdated
@@ -862,13 +862,26 @@ func TestMemberList_ResetNodes(t *testing.T) { | |||
d := dead{Node: "test2", Incarnation: 1} | |||
m.deadNode(&d) | |||
|
|||
oldGossipToTheDeadTime := m.config.GossipToTheDeadTime | |||
m.config.GossipToTheDeadTime = 3 * time.Second |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's set this to something like 200 * time.Millisecond
so the test doesn't take too long.
Makes sense. Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more one liner!
state_test.go
Outdated
t.Fatalf("test2 should not be unmapped") | ||
} | ||
|
||
time.Sleep(5 * time.Second) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can knock this one down, too.
pre v0.1.0 interesting changes: * a bugfix for GossipToTheDeadTime (hashicorp/memberlist#106) post v0.1.0 interesting changes: * Reduce LAN min suspicion multiplier (hashicorp/memberlist#129)
pre v0.1.0 interesting changes: * a bugfix for GossipToTheDeadTime (hashicorp/memberlist#106) post v0.1.0 interesting changes: * Reduce LAN min suspicion multiplier (hashicorp/memberlist#129)
pre v0.1.0 interesting changes: * a bugfix for GossipToTheDeadTime (hashicorp/memberlist#106) post v0.1.0 interesting changes: * Reduce LAN min suspicion multiplier (hashicorp/memberlist#129)
pre v0.1.0 interesting changes: * a bugfix for GossipToTheDeadTime (hashicorp/memberlist#106) post v0.1.0 interesting changes: * Reduce LAN min suspicion multiplier (hashicorp/memberlist#129)
#99 introduced
Config.GossipToTheDeadTime
.resetNodes()
is called when a node gets to the end of its randomized list of nodes to gossip with. It should not remove dead nodes if they entered the dead state less thanConfig.GossipToTheDeadTime
ago.