diff --git a/src/contrib/cluster/Akka.Cluster.Sharding/ShardRegion.cs b/src/contrib/cluster/Akka.Cluster.Sharding/ShardRegion.cs index a51b5c56098..6ed47e49bf4 100644 --- a/src/contrib/cluster/Akka.Cluster.Sharding/ShardRegion.cs +++ b/src/contrib/cluster/Akka.Cluster.Sharding/ShardRegion.cs @@ -92,8 +92,8 @@ private MemberAgeComparer() { } public int Compare(Member x, Member y) { - if (y.IsOlderThan(x)) return -1; - return x.IsOlderThan(y) ? 1 : 0; + if (x.IsOlderThan(y)) return -1; + return y.IsOlderThan(x) ? 1 : 0; } } diff --git a/src/core/Akka.Cluster.Tests/TestMember.cs b/src/core/Akka.Cluster.Tests/TestMember.cs index ca47d7d40a3..e25242c29ae 100644 --- a/src/core/Akka.Cluster.Tests/TestMember.cs +++ b/src/core/Akka.Cluster.Tests/TestMember.cs @@ -19,7 +19,7 @@ public static Member Create(Address address, MemberStatus status) public static Member Create(Address address, MemberStatus status, ImmutableHashSet roles) { - return Member.Create(new UniqueAddress(address, 0), status, roles); + return Member.Create(new UniqueAddress(address, 0), 0, status, roles); } } } diff --git a/src/core/Akka.Cluster/Member.cs b/src/core/Akka.Cluster/Member.cs index 79a1850ee62..7977c142844 100644 --- a/src/core/Akka.Cluster/Member.cs +++ b/src/core/Akka.Cluster/Member.cs @@ -52,9 +52,9 @@ public static Member Removed(UniqueAddress node) readonly ImmutableHashSet _roles; public ImmutableHashSet Roles { get { return _roles; } } - public static Member Create(UniqueAddress uniqueAddress, MemberStatus status, ImmutableHashSet roles) + public static Member Create(UniqueAddress uniqueAddress, int upNumber, MemberStatus status, ImmutableHashSet roles) { - return new Member(uniqueAddress, 0, status, roles); + return new Member(uniqueAddress, upNumber, status, roles); } Member(UniqueAddress uniqueAddress, int upNumber, MemberStatus status, ImmutableHashSet roles) diff --git a/src/core/Akka.Cluster/Proto/ClusterMessageSerializer.cs b/src/core/Akka.Cluster/Proto/ClusterMessageSerializer.cs index f2303ef5510..fc2f60eadd3 100644 --- a/src/core/Akka.Cluster/Proto/ClusterMessageSerializer.cs +++ b/src/core/Akka.Cluster/Proto/ClusterMessageSerializer.cs @@ -456,7 +456,7 @@ private Gossip GossipFromProto(Msg.Gossip gossip) return new Reachability(recordBuilder.ToImmutable(), versionsBuilder.ToImmutable()); }; - Func memberFromProto = member => Member.Create(addressMapping[member.AddressIndex], MemberStatusFromProto[member.Status], + Func memberFromProto = member => Member.Create(addressMapping[member.AddressIndex], member.HasUpNumber ? member.UpNumber : 0, MemberStatusFromProto[member.Status], member.RolesIndexesList.Select(x => roleMapping[x]).ToImmutableHashSet()); var members = gossip.MembersList.Select(memberFromProto).ToImmutableSortedSet(Member.Ordering); diff --git a/src/core/Akka/Actor/ActorPath.cs b/src/core/Akka/Actor/ActorPath.cs index 370caea6596..49a961e56ce 100644 --- a/src/core/Akka/Actor/ActorPath.cs +++ b/src/core/Akka/Actor/ActorPath.cs @@ -254,7 +254,8 @@ public bool Equals(ActorPath other) var a = path; foreach (string element in name) { - a = a / element; + if(!string.IsNullOrEmpty(element)) + a = a / element; } return a; }