geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bschucha...@apache.org
Subject incubator-geode git commit: GEODE-77 fixed ability to shut down a rogue member
Date Wed, 14 Oct 2015 16:51:54 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-77 4f1a943f5 -> 3e1a9f69b


GEODE-77 fixed ability to shut down a rogue member


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/3e1a9f69
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/3e1a9f69
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/3e1a9f69

Branch: refs/heads/feature/GEODE-77
Commit: 3e1a9f69b0d07e311cc261656d6ba553b7120072
Parents: 4f1a943
Author: Bruce Schuchardt <bschuchardt@pivotal.io>
Authored: Wed Oct 14 09:51:34 2015 -0700
Committer: Bruce Schuchardt <bschuchardt@pivotal.io>
Committed: Wed Oct 14 09:51:34 2015 -0700

----------------------------------------------------------------------
 .../membership/gms/membership/GMSJoinLeave.java       | 14 +++++++++-----
 .../membership/gms/messenger/GMSQuorumChecker.java    |  8 ++++----
 .../gemfire/cache/query/data/PortfolioPdx.java        |  3 +++
 .../gemfire/cache30/TXDistributedDUnitTest.java       |  8 ++++++++
 4 files changed, 24 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3e1a9f69/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/membership/GMSJoinLeave.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/membership/GMSJoinLeave.java
b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/membership/GMSJoinLeave.java
index 933f802..4ebc20c 100755
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/membership/GMSJoinLeave.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/membership/GMSJoinLeave.java
@@ -584,7 +584,7 @@ public class GMSJoinLeave implements JoinLeave, MessageHandler {
     }
   }
   
-  private void sendRemoveMessages(Set<InternalDistributedMember> removals,
+  private void sendRemoveMessages(List<InternalDistributedMember> removals,
       List<String> reasons, NetView newView) {
     Iterator<String> reason = reasons.iterator();
     for (InternalDistributedMember mbr: removals) {
@@ -1615,7 +1615,7 @@ public class GMSJoinLeave implements JoinLeave, MessageHandler {
             }
           } // synchronized
           if (requests != null  && !requests.isEmpty()) {
-            logger.debug("View Creator is processing {} requests for the next membership
view", requests.size());
+            logger.info("View Creator is processing {} requests for the next membership view",
requests.size());
             try {
               createAndSendView(requests);
             } catch (DistributedSystemDisconnectedException e) {
@@ -1636,7 +1636,7 @@ public class GMSJoinLeave implements JoinLeave, MessageHandler {
     void createAndSendView(List<DistributionMessage> requests) {
       List<InternalDistributedMember> joinReqs = new ArrayList<>();
       Set<InternalDistributedMember> leaveReqs = new HashSet<>();
-      Set<InternalDistributedMember> removalReqs = new HashSet<>();
+      List<InternalDistributedMember> removalReqs = new ArrayList<>();
       List<String> removalReasons = new ArrayList<String>();
 
       NetView oldView = currentView;
@@ -1678,6 +1678,10 @@ public class GMSJoinLeave implements JoinLeave, MessageHandler {
           if (oldMembers.contains(mbr) && !leaveReqs.contains(mbr) && !removalReqs.contains(mbr))
{
             removalReqs.add(mbr);
             removalReasons.add(((RemoveMemberMessage) msg).getReason());
+          } else {
+            sendRemoveMessages(Collections.<InternalDistributedMember>singletonList(mbr),
+                Collections.<String>singletonList(((RemoveMemberMessage)msg).getReason()),
+                currentView);
           }
           break;
         default: 
@@ -1711,7 +1715,7 @@ public class GMSJoinLeave implements JoinLeave, MessageHandler {
         mbrs.removeAll(leaveReqs);
         mbrs.removeAll(removalReqs);
         newView = new NetView(localAddress, viewNumber, mbrs, leaveReqs,
-            removalReqs);
+            new HashSet<InternalDistributedMember>(removalReqs));
       }
       
       // if there are no membership changes then abort creation of
@@ -1735,7 +1739,7 @@ public class GMSJoinLeave implements JoinLeave, MessageHandler {
         sendJoinResponses(joinReqs, newView);
       }
 
-      prepareAndSendView(newView, joinReqs, leaveReqs, removalReqs);
+      prepareAndSendView(newView, joinReqs, leaveReqs, newView.getCrashedMembers());
       return;
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3e1a9f69/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/messenger/GMSQuorumChecker.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/messenger/GMSQuorumChecker.java
b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/messenger/GMSQuorumChecker.java
index fead37b..13153a4 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/messenger/GMSQuorumChecker.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/distributed/internal/membership/gms/messenger/GMSQuorumChecker.java
@@ -172,7 +172,7 @@ public class GMSQuorumChecker implements QuorumChecker {
         try {
           pingPonger.sendPingMessage(channel, myAddress, dest);
         } catch (Exception e) {
-          logger.info("Failed sending Ping message to " + dest);
+          logger.debug("Failed sending Ping message to " + dest);
         }
       }
     }
@@ -189,7 +189,7 @@ public class GMSQuorumChecker implements QuorumChecker {
           try {
             pingPonger.sendPongMessage(channel, myAddress, msg.getSrc());
           } catch (Exception e) {
-            logger.info("Failed sending Pong message to " + msg.getSrc());
+            logger.debug("Failed sending Pong message to " + msg.getSrc());
           }
         } else if (pingPonger.isPongMessage(msgBytes)) {
           pongReceived(msg.getSrc());
@@ -228,13 +228,13 @@ public class GMSQuorumChecker implements QuorumChecker {
     }
 
     public void pongReceived(Address sender) {
-      logger.info("received ping-pong response from {}", sender);
+      logger.debug("received ping-pong response from {}", sender);
       JGAddress jgSender = (JGAddress) sender;
       SocketAddress sockaddr = new InetSocketAddress(jgSender.getInetAddress(), jgSender.getPort());
       InternalDistributedMember memberAddr = addressConversionMap.get(sockaddr);
 
       if (memberAddr != null) {
-        logger.info("quorum check: mapped address to member ID {}", memberAddr);
+        logger.debug("quorum check: mapped address to member ID {}", memberAddr);
         receivedAcks.add(memberAddr);
       }
     }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3e1a9f69/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/data/PortfolioPdx.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/data/PortfolioPdx.java
b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/data/PortfolioPdx.java
index 9dba8d2..8932fe1 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/data/PortfolioPdx.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/data/PortfolioPdx.java
@@ -32,6 +32,7 @@ import com.gemstone.gemfire.pdx.PdxWriter;
 
 
 public class PortfolioPdx implements Serializable, PdxSerializable  {
+  public static boolean DEBUG = false;
 
   public enum Day {
     Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday
@@ -129,11 +130,13 @@ public class PortfolioPdx implements Serializable, PdxSerializable 
{
   /* public no-arg constructor required for Deserializable */
   public PortfolioPdx() {
     this.numInstance++;
+    if (DEBUG) Thread.dumpStack();
 //    GemFireCacheImpl.getInstance().getLoggerI18n().fine(new Exception("DEBUG"));
   }
 
   public PortfolioPdx(int i) {
     aDay = (Day)(dayList.get((i % dayList.size())));
+    if (DEBUG) Thread.dumpStack();
     this.numInstance++;
     ID = i;
     if(i % 2 == 0) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/3e1a9f69/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/TXDistributedDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/TXDistributedDUnitTest.java
b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/TXDistributedDUnitTest.java
index 6d36646..a59a3d5 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/TXDistributedDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/TXDistributedDUnitTest.java
@@ -27,6 +27,7 @@ import java.io.IOException;
 import java.io.Serializable;
 import java.util.HashSet;
 import java.util.List;
+import java.util.Properties;
 import java.util.concurrent.CountDownLatch;
 
 import junit.framework.AssertionFailedError;
@@ -508,6 +509,13 @@ public class TXDistributedDUnitTest extends CacheTestCase {
       });
 
   }
+  
+  @Override
+  public Properties getDistributedSystemProperties() {
+    Properties p = super.getDistributedSystemProperties();
+    p.put("log-level", "fine");
+    return p;
+  }
 
   public void testHighAvailabilityFeatures() throws Exception {
     addExpectedException("DistributedSystemDisconnectedException");


Mime
View raw message