fix usage of the the leader sorted set in Replicator
* since the ordering can change based on the member's status it's not possible to use ordinary - for removal * similar issue at a few places where ageOrdering was used
This commit is contained in:
parent
f5a40bfcb2
commit
0b1ce7223d
3 changed files with 22 additions and 8 deletions
|
|
@ -1740,7 +1740,8 @@ final class Replicator(settings: ReplicatorSettings) extends Actor with ActorLog
|
|||
if (m.address == selfAddress)
|
||||
context stop self
|
||||
else if (matchingRole(m)) {
|
||||
leader -= m
|
||||
// filter, it's possible that the ordering is changed since it based on MemberStatus
|
||||
leader = leader.filterNot(_.uniqueAddress == m.uniqueAddress)
|
||||
nodes -= m.address
|
||||
weaklyUpNodes -= m.address
|
||||
log.debug("adding removed node [{}] from MemberRemoved", m.uniqueAddress)
|
||||
|
|
@ -1752,8 +1753,9 @@ final class Replicator(settings: ReplicatorSettings) extends Actor with ActorLog
|
|||
|
||||
def receiveOtherMemberEvent(m: Member): Unit =
|
||||
if (matchingRole(m)) {
|
||||
// update changed status
|
||||
leader = (leader - m) + m
|
||||
// replace, it's possible that the ordering is changed since it based on MemberStatus
|
||||
leader = leader.filterNot(_.uniqueAddress == m.uniqueAddress)
|
||||
leader += m
|
||||
}
|
||||
|
||||
def receiveUnreachable(m: Member): Unit =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue