Skip to content
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 bugs with multiple Members with same Address crashing ClusterDaemon #7371

Merged

Conversation

Aaronontheweb
Copy link
Member

@Aaronontheweb Aaronontheweb commented Oct 30, 2024

Changes

close #7370

Checklist

For significant changes, please ensure that the following have been completed (delete if not relevant):

Copy link
Member Author

@Aaronontheweb Aaronontheweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Detailed my changes - gathering MNTR data on the build server and locally on my machine now.

@@ -1635,22 +1635,22 @@ public void Welcome(Address joinWith, UniqueAddress from, Gossip gossip)
public void Leaving(Address address)
{
// only try to update if the node is available (in the member ring)
if (LatestGossip.Members.Any(m => m.Address.Equals(address) && m.Status is MemberStatus.Joining or MemberStatus.WeaklyUp or MemberStatus.Up))
foreach(var mem in LatestGossip.Members.Where(m => m.Address.Equals(address)))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TLDR - iterate over each Member with the same Address and filter them one at a time - don't do what we did before, which is to check if there are members that match this condition and then try to state-transition them all at the same time. This is what creates the IllegalOperation: invalid state transition errors.

var member = localMembers.FirstOrDefault(m => m.Address == address);
if (member != null && member.Status != MemberStatus.Down)
var found = false;
foreach (var member in localMembers.Where(m => m.Address == address))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found the same type of issue with the Downing function too and made similar fixes there.

Copy link
Contributor

@Arkatufus Arkatufus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had some questions

src/core/Akka.Cluster/ClusterDaemon.cs Show resolved Hide resolved
src/core/Akka.Cluster/ClusterDaemon.cs Show resolved Hide resolved
@Arkatufus Arkatufus merged commit 0cbddb5 into akkadotnet:dev Oct 30, 2024
12 checks passed
@Aaronontheweb Aaronontheweb deleted the fix-7370-ClusterDaemon-dupe-members branch October 30, 2024 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants