You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by bs...@apache.org on 2019/01/03 22:43:09 UTC

[geode] branch feature/GEODE-6244 updated: leave the member unsuspected after final check fails

This is an automated email from the ASF dual-hosted git repository.

bschuchardt pushed a commit to branch feature/GEODE-6244
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/feature/GEODE-6244 by this push:
     new fb3dfd0  leave the member unsuspected after final check fails
fb3dfd0 is described below

commit fb3dfd00477cc48fb2d4dd85fe1ec532ed68f82b
Author: Bruce Schuchardt <bs...@pivotal.io>
AuthorDate: Thu Jan 3 14:22:51 2019 -0800

    leave the member unsuspected after final check fails
    
    If the final check fails and we're not going to remove the suspect from
    the distributed system we need to leave it in an "unsuspected" state
    locally so that the background monitoring thread will look at it again.
    
    Also, if the final check failed in the membership coordinator there's no
    point in doing another check so we move directly to removing the
    suspect.
---
 .../membership/gms/fd/GMSHealthMonitorJUnitTest.java        |  4 ++--
 .../internal/membership/gms/fd/GMSHealthMonitor.java        | 13 +++++++++----
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/fd/GMSHealthMonitorJUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/fd/GMSHealthMonitorJUnitTest.java
index baab496..bfb25d4 100644
--- a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/fd/GMSHealthMonitorJUnitTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/fd/GMSHealthMonitorJUnitTest.java
@@ -150,7 +150,7 @@ public class GMSHealthMonitorJUnitTest {
     when(stopper.isCancelInProgress()).thenReturn(false);
 
     if (mockMembers == null) {
-      mockMembers = new ArrayList<InternalDistributedMember>();
+      mockMembers = new ArrayList<>();
       for (int i = 0; i < 7; i++) {
         InternalDistributedMember mbr = new InternalDistributedMember("localhost", 8888 + i);
 
@@ -628,7 +628,7 @@ public class GMSHealthMonitorJUnitTest {
     boolean available = gmsHealthMonitor.checkIfAvailable(memberToCheck, "Not responding", false);
     assertFalse(available);
     verify(joinLeave, never()).remove(isA(InternalDistributedMember.class), isA(String.class));
-    assertTrue(gmsHealthMonitor.isSuspectMember(memberToCheck));
+    assertFalse(gmsHealthMonitor.isSuspectMember(memberToCheck));
     verify(messenger).send(isA(SuspectMembersMessage.class));
   }
 
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/fd/GMSHealthMonitor.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/fd/GMSHealthMonitor.java
index cccf285..b225721 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/fd/GMSHealthMonitor.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/fd/GMSHealthMonitor.java
@@ -1225,7 +1225,7 @@ public class GMSHealthMonitor implements HealthMonitor, MessageHandler {
   }
 
   protected boolean inlineCheckIfAvailable(final InternalDistributedMember initiator,
-      final NetView cv, boolean initiateRemoval, final InternalDistributedMember mbr,
+      final NetView cv, boolean forceRemovalIfCheckFails, final InternalDistributedMember mbr,
       final String reason) {
 
     if (services.getJoinLeave().isMemberLeaving(mbr)) {
@@ -1272,14 +1272,19 @@ public class GMSHealthMonitor implements HealthMonitor, MessageHandler {
         TimeStamp ts = memberTimeStamps.get(mbr);
         if (ts == null || ts.getTime() < startTime) {
           logger.info("Final check failed for member {}", mbr);
-          if (initiateRemoval) {
+          // if the final check fails & this VM is the coordinator we don't need to do another final
+          // check
+          if (forceRemovalIfCheckFails
+              || this.currentView.getCoordinator().equals(this.localAddress)) {
             logger.info("Requesting removal of suspect member {}", mbr);
             services.getJoinLeave().remove(mbr, reason);
+            // make sure it is still suspected
+            memberSuspected(localAddress, mbr, reason);
           } else {
+            // tell peers about this member and then set up to continue watching it
             initiateSuspicion(mbr, reason);
+            memberUnsuspected(mbr);
           }
-          // make sure it is still suspected
-          memberSuspected(localAddress, mbr, reason);
           failed = true;
         } else {
           logger.info(