ARTEMIS-1484 Live's topology update may be ignored

If the current node has no connector to Live, it is better
to update it from older message than to have none.
This commit is contained in:
Erich Duda 2017-10-26 15:36:24 +02:00
parent 9a5a3d496d
commit 84fb07be53
1 changed files with 7 additions and 2 deletions

View File

@ -202,7 +202,7 @@ public final class Topology {
sendMemberUp(nodeId, memberInput); sendMemberUp(nodeId, memberInput);
return true; return true;
} }
if (uniqueEventID > currentMember.getUniqueEventID()) { if (uniqueEventID > currentMember.getUniqueEventID() || (currentMember.getLive() == null && memberInput.getLive() != null)) {
TopologyMemberImpl newMember = new TopologyMemberImpl(nodeId, memberInput.getBackupGroupName(), memberInput.getScaleDownGroupName(), memberInput.getLive(), memberInput.getBackup()); TopologyMemberImpl newMember = new TopologyMemberImpl(nodeId, memberInput.getBackupGroupName(), memberInput.getScaleDownGroupName(), memberInput.getLive(), memberInput.getBackup());
if (newMember.getLive() == null && currentMember.getLive() != null) { if (newMember.getLive() == null && currentMember.getLive() != null) {
@ -219,7 +219,12 @@ public final class Topology {
newMember, new Exception("trace")); newMember, new Exception("trace"));
} }
newMember.setUniqueEventID(uniqueEventID); if (uniqueEventID > currentMember.getUniqueEventID()) {
newMember.setUniqueEventID(uniqueEventID);
} else {
newMember.setUniqueEventID(currentMember.getUniqueEventID());
}
topology.remove(nodeId); topology.remove(nodeId);
topology.put(nodeId, newMember); topology.put(nodeId, newMember);
sendMemberUp(nodeId, newMember); sendMemberUp(nodeId, newMember);