Bill commented on a change in pull request #5984:
URL: https://github.com/apache/geode/pull/5984#discussion_r571217658
##########
File path:
geode-membership/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/fd/GMSHealthMonitorJUnitTest.java
##########
@@ -656,6 +656,50 @@ public void
testFinalCheckInProgressPreemptsLivenessGossip() throws Exception {
assertThat(testMonitor.getContactTimestamp(memberToCheck)).isEqualTo(timestamp);
}
+ @Test
+ public void testMemberIsAvailableWhenInFinalCheck() throws Exception {
+ useGMSHealthMonitorTestClass = true;
+ simulateHeartbeatInGMSHealthMonitorTestClass = false;
+
+ GMSMembershipView v = installAView();
Review comment:
can this be `final`? You can configure IJ to highlight these for you.
##########
File path:
geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/fd/GMSHealthMonitor.java
##########
@@ -670,7 +670,13 @@ public void suspect(ID mbr, String reason) {
@Override
public boolean checkIfAvailable(ID mbr, String reason,
boolean initiateRemoval) {
- if (membersInFinalCheck.contains(mbr)) {
+ return checkIfAvailable(mbr, reason, initiateRemoval, true);
+ }
+
+ @Override
+ public boolean checkIfAvailable(ID mbr, String reason,
+ boolean initiateRemoval, boolean checkIfMemberInFinalCheck) {
Review comment:
suggest renaming parameter `checkIfMemberInFinalCheck` to
`assumeMembersInFinalCheckAreAvailable` since the latter makes more sense to
callers who haven't read the internals of the method
##########
File path:
geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeave.java
##########
@@ -1454,10 +1454,14 @@ void processMessage(NetworkPartitionMessage<ID> msg) {
if (isStopping) {
return;
}
-
- String str = "Membership coordinator " + msg.getSender()
- + " has declared that a network partition has occurred";
- forceDisconnect(str);
+ ID sender = msg.getSender();
+ if (getView().getMembers().contains(sender)) {
+ String str = "Membership coordinator " + msg.getSender()
+ + " has declared that a network partition has occurred";
+ forceDisconnect(str);
+ } else {
+ logger.warn("Ignoring the network partition message from a non-member: "
+ msg.getSender());
+ }
Review comment:
Should we be honoring messages from surprise members too @bschuchardt ?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]