Skip to content

Conversation

Aaronontheweb
Copy link
Member

closes #2014

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;
Copy link
Member Author

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)
Copy link
Member Author

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);
Copy link
Member Author

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

@Aaronontheweb
Copy link
Member Author

FYI, the change that is missing is just this FAKE backport for once we split .NET Core tests on v1.3 #2787

Doesn't affect the Akka.NET code itself.

@alexvaluyskiy alexvaluyskiy merged commit 933cc42 into akkadotnet:dev Jun 23, 2017
@Aaronontheweb Aaronontheweb deleted the fix-2014-node-transition-spec branch June 23, 2017 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Port Akka.Cluster MultiNodeSpec: TransitionSpec
2 participants