-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fixed node transition spec #2788
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
Fixed node transition spec #2788
Conversation
return roles.First(); | ||
// sorts the addresses and provides the address of the node with the lowest port number | ||
// as that node will be the leader | ||
return roles.Select(x => Tuple.Create(x, GetAddress(x).Port)).OrderBy(x => x.Item2).First().Item1; |
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.
This was the fix - needed to be able to correctly pick the leader from the remaining nodes and not just assume that the first node in the list == the leader.
@@ -61,7 +64,7 @@ private RoleName[] NonLeader(params RoleName[] roles) | |||
|
|||
private MemberStatus MemberStatus(Address address) | |||
{ | |||
var status = ClusterView.Members.Concat(ClusterView.UnreachableMembers) | |||
var status = ClusterView.Members.Union(ClusterView.UnreachableMembers) |
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.
Used the Union
method here to filter out duplicates and be consistent with the JVM.
@@ -256,6 +259,7 @@ private void A_Cluster_must_perform_correct_transitions_when_third_joins_second( | |||
EnterBarrier("convergence-joining-3"); | |||
|
|||
var leader12 = Leader(_config.First, _config.Second); | |||
Log.Debug("Leader: {0}", leader12); |
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.
Used this to help expose the bug; won't log anything by default since we run with DebugConfig = false
FYI, the change that is missing is just this FAKE backport for once we split .NET Core tests on Doesn't affect the Akka.NET code itself. |
closes #2014