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

brandonwilliams pushed a commit to branch cassandra-3.11
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/cassandra-3.11 by this push:
     new edf22ed776 Revert 18543 but retain properties
edf22ed776 is described below

commit edf22ed776d36112c165c6858dd4866b754ecf34
Author: Brandon Williams <brandonwilli...@apache.org>
AuthorDate: Fri Sep 15 06:08:13 2023 -0500

    Revert 18543 but retain properties
    
    Patch by brandonwilliams; reviewed by dcapwell for CASSANDRA-18854
---
 CHANGES.txt                                     |  1 +
 src/java/org/apache/cassandra/gms/Gossiper.java | 38 +++----------------------
 2 files changed, 5 insertions(+), 34 deletions(-)

diff --git a/CHANGES.txt b/CHANGES.txt
index d5eb1048dc..2d9e2059e1 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.11.17
+ * Revert CASSANDRA-18543 (CASSANDRA-18854)
  * Fix NPE when using udfContext in UDF after a restart of a node 
(CASSANDRA-18739)
 Merged from 3.0:
  * Add cqlshrc.sample and credentials.sample into Debian package 
(CASSANDRA-18818)
diff --git a/src/java/org/apache/cassandra/gms/Gossiper.java 
b/src/java/org/apache/cassandra/gms/Gossiper.java
index ac35aa8642..b3783cd5b5 100644
--- a/src/java/org/apache/cassandra/gms/Gossiper.java
+++ b/src/java/org/apache/cassandra/gms/Gossiper.java
@@ -39,8 +39,6 @@ import com.google.common.util.concurrent.ListenableFutureTask;
 import com.google.common.util.concurrent.Uninterruptibles;
 
 import io.netty.util.concurrent.FastThreadLocal;
-import org.apache.cassandra.exceptions.RequestFailureReason;
-import org.apache.cassandra.net.IAsyncCallbackWithFailure;
 import org.apache.cassandra.utils.ExecutorUtils;
 import org.apache.cassandra.utils.MBeanWrapper;
 import org.apache.cassandra.utils.NoSpamLogger;
@@ -137,9 +135,6 @@ public class Gossiper implements 
IFailureDetectionEventListener, GossiperMBean
     /* live member set */
     private final Set<InetAddress> liveEndpoints = new 
ConcurrentSkipListSet<InetAddress>(inetcomparator);
 
-    /* Inflight echo requests. */
-    private final Set<InetAddress> inflightEcho = new 
ConcurrentSkipListSet<>(inetcomparator);
-
     /* unreachable member set */
     private final Map<InetAddress, Long> unreachableEndpoints = new 
ConcurrentHashMap<InetAddress, Long>();
 
@@ -534,7 +529,6 @@ public class Gossiper implements 
IFailureDetectionEventListener, GossiperMBean
         }
 
         liveEndpoints.remove(endpoint);
-        inflightEcho.remove(endpoint);
         unreachableEndpoints.remove(endpoint);
         MessagingService.instance().resetVersion(endpoint);
         quarantineEndpoint(endpoint);
@@ -1132,23 +1126,12 @@ public class Gossiper implements 
IFailureDetectionEventListener, GossiperMBean
             return;
         }
 
-        if (inflightEcho.contains(addr))
-        {
-            return;
-        }
-        inflightEcho.add(addr);
-
         localState.markDead();
 
         MessageOut<EchoMessage> echoMessage = new 
MessageOut<EchoMessage>(MessagingService.Verb.ECHO, EchoMessage.instance, 
EchoMessage.serializer);
         logger.trace("Sending a EchoMessage to {}", addr);
-        IAsyncCallbackWithFailure echoHandler = new IAsyncCallbackWithFailure()
+        IAsyncCallback echoHandler = new IAsyncCallback()
         {
-            public void onFailure(InetAddress from, RequestFailureReason 
failureReason)
-            {
-                inflightEcho.remove(addr);
-            }
-
             public boolean isLatencyForSnitch()
             {
                 return false;
@@ -1156,20 +1139,11 @@ public class Gossiper implements 
IFailureDetectionEventListener, GossiperMBean
 
             public void response(MessageIn msg)
             {
-                runInGossipStageBlocking(() -> {
-                    try
-                    {
-                        realMarkAlive(addr, localState);
-                    }
-                    finally
-                    {
-                        inflightEcho.remove(addr);
-                    }
-                });
+                runInGossipStageBlocking(() -> realMarkAlive(addr, 
localState));
             }
         };
 
-        MessagingService.instance().sendRRWithFailure(echoMessage, addr, 
echoHandler);
+        MessagingService.instance().sendRR(echoMessage, addr, echoHandler);
     }
 
     @VisibleForTesting
@@ -1199,7 +1173,6 @@ public class Gossiper implements 
IFailureDetectionEventListener, GossiperMBean
             logger.trace("marking as down {}", addr);
         localState.markDead();
         liveEndpoints.remove(addr);
-        inflightEcho.remove(addr);
         unreachableEndpoints.put(addr, System.nanoTime());
         logger.info("InetAddress {} is now DOWN", addr);
         for (IEndpointStateChangeSubscriber subscriber : subscribers)
@@ -1898,14 +1871,12 @@ public class Gossiper implements 
IFailureDetectionEventListener, GossiperMBean
         int totalPolls = 0;
         int numOkay = 0;
         int epSize = Gossiper.instance.getEndpointStates().size();
-        int liveSize = Gossiper.instance.getLiveMembers().size();
         while (numOkay < GOSSIP_SETTLE_POLL_SUCCESSES_REQUIRED)
         {
             
Uninterruptibles.sleepUninterruptibly(GOSSIP_SETTLE_POLL_INTERVAL_MS, 
TimeUnit.MILLISECONDS);
             int currentSize = Gossiper.instance.getEndpointStates().size();
-            int currentLive = Gossiper.instance.getLiveMembers().size();
             totalPolls++;
-            if (currentSize == epSize && currentLive == liveSize)
+            if (currentSize == epSize)
             {
                 logger.debug("Gossip looks settled.");
                 numOkay++;
@@ -1916,7 +1887,6 @@ public class Gossiper implements 
IFailureDetectionEventListener, GossiperMBean
                 numOkay = 0;
             }
             epSize = currentSize;
-            liveSize = currentLive;
             if (forceAfter > 0 && totalPolls > forceAfter)
             {
                 logger.warn("Gossip not settled but startup forced by 
cassandra.skip_wait_for_gossip_to_settle. Gossip total polls: {}",


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to