cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [05/15] cassandra git commit: Maybe retry sending digest syn during shadow round
Date Fri, 08 Jan 2016 16:12:28 GMT
Maybe retry sending digest syn during shadow round

Patch by Stefania Alborghetti; reviewed by Sam Tunnicliffe for
CASSANDRA-8072


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/0f27d68f
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/0f27d68f
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/0f27d68f

Branch: refs/heads/cassandra-3.3
Commit: 0f27d68fc23a942c0fa27ba4662621891939eaed
Parents: 812df9e
Author: Stefania Alborghetti <stefania.alborghetti@datastax.com>
Authored: Sat Dec 19 14:23:52 2015 +0100
Committer: Sam Tunnicliffe <sam@beobal.com>
Committed: Fri Jan 8 15:54:17 2016 +0000

----------------------------------------------------------------------
 CHANGES.txt                                            |  1 +
 src/java/org/apache/cassandra/gms/Gossiper.java        | 13 ++++++++++---
 .../apache/cassandra/net/IncomingTcpConnection.java    |  2 ++
 .../apache/cassandra/net/OutboundTcpConnection.java    |  2 ++
 4 files changed, 15 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/0f27d68f/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index c167098..a6a0c60 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.13
+ * Retry sending gossip syn multiple times during shadow round (CASSANDRA-8072)
  * Fix pending range calculation during moves (CASSANDRA-10887)
  * Sane default (200Mbps) for inter-DC streaming througput (CASSANDRA-9708)
  * Match cassandra-loader options in COPY FROM (CASSANDRA-9303)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0f27d68f/src/java/org/apache/cassandra/gms/Gossiper.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/gms/Gossiper.java b/src/java/org/apache/cassandra/gms/Gossiper.java
index 130b531..59ef3cc 100644
--- a/src/java/org/apache/cassandra/gms/Gossiper.java
+++ b/src/java/org/apache/cassandra/gms/Gossiper.java
@@ -122,7 +122,7 @@ public class Gossiper implements IFailureDetectionEventListener, GossiperMBean
 
     private final Map<InetAddress, Long> expireTimeEndpointMap = new ConcurrentHashMap<InetAddress,
Long>();
 
-    private boolean inShadowRound = false;
+    private volatile boolean inShadowRound = false;
 
     private volatile long lastProcessedMessageAt = System.currentTimeMillis();
 
@@ -1321,17 +1321,24 @@ public class Gossiper implements IFailureDetectionEventListener, GossiperMBean
         MessageOut<GossipDigestSyn> message = new MessageOut<GossipDigestSyn>(MessagingService.Verb.GOSSIP_DIGEST_SYN,
                 digestSynMessage,
                 GossipDigestSyn.serializer);
+
         inShadowRound = true;
-        for (InetAddress seed : seeds)
-            MessagingService.instance().sendOneWay(message, seed);
         int slept = 0;
         try
         {
             while (true)
             {
+                if (slept % 5000 == 0)
+                { // CASSANDRA-8072, retry at the beginning and every 5 seconds
+                    logger.trace("Sending shadow round GOSSIP DIGEST SYN to seeds {}", seeds);
+                    for (InetAddress seed : seeds)
+                        MessagingService.instance().sendOneWay(message, seed);
+                }
+
                 Thread.sleep(1000);
                 if (!inShadowRound)
                     break;
+
                 slept += 1000;
                 if (slept > StorageService.RING_DELAY)
                     throw new RuntimeException("Unable to gossip with any seeds");

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0f27d68f/src/java/org/apache/cassandra/net/IncomingTcpConnection.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/net/IncomingTcpConnection.java b/src/java/org/apache/cassandra/net/IncomingTcpConnection.java
index 09ce717..198976b 100644
--- a/src/java/org/apache/cassandra/net/IncomingTcpConnection.java
+++ b/src/java/org/apache/cassandra/net/IncomingTcpConnection.java
@@ -111,6 +111,8 @@ public class IncomingTcpConnection extends Thread implements Closeable
     {
         try
         {
+            if (logger.isTraceEnabled())
+                logger.trace("Closing socket {} - isclosed: {}", socket, socket.isClosed());
             if (!socket.isClosed())
             {
                 socket.close();

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0f27d68f/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/net/OutboundTcpConnection.java b/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
index 8b83119..dfebe9a 100644
--- a/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
+++ b/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
@@ -352,6 +352,8 @@ public class OutboundTcpConnection extends Thread
             try
             {
                 socket.close();
+                if (logger.isTraceEnabled())
+                    logger.trace("Socket to {} closed", poolReference.endPoint());
             }
             catch (IOException e)
             {


Mime
View raw message