You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by br...@apache.org on 2020/02/26 21:05:01 UTC

[cassandra] 01/01: Allow overriding Gossiper.aVeryLongTime

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

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

commit f0775f1db1c9404a1cf81080a609c5465b407344
Author: Brandon Williams <br...@apache.org>
AuthorDate: Wed Feb 26 15:04:06 2020 -0600

    Allow overriding Gossiper.aVeryLongTime
    
    Patch by brandonwilliams for CASSANDRA-15569
---
 src/java/org/apache/cassandra/gms/Gossiper.java | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/java/org/apache/cassandra/gms/Gossiper.java b/src/java/org/apache/cassandra/gms/Gossiper.java
index ef7b093..f276fbd 100644
--- a/src/java/org/apache/cassandra/gms/Gossiper.java
+++ b/src/java/org/apache/cassandra/gms/Gossiper.java
@@ -114,7 +114,7 @@ public class Gossiper implements IFailureDetectionEventListener, GossiperMBean
     // Timestamp to prevent processing any in-flight messages for we've not send any SYN yet, see CASSANDRA-12653.
     volatile long firstSynSendAt = 0L;
 
-    public static final long aVeryLongTime = 259200 * 1000; // 3 days
+    public static final long aVeryLongTime = getVeryLongTime();
 
     // Maximimum difference between generation value and local time we are willing to accept about a peer
     static final int MAX_GENERATION_DIFFERENCE = 86400 * 365;
@@ -189,6 +189,17 @@ public class Gossiper implements IFailureDetectionEventListener, GossiperMBean
 
     private static final boolean disableThreadValidation = Boolean.getBoolean(Props.DISABLE_THREAD_VALIDATION);
 
+    private static long getVeryLongTime()
+    {
+        String newVLT =  System.getProperty("cassandra.very_long_time_ms");
+        if (newVLT != null)
+        {
+            logger.info("Overriding aVeryLongTime to {}ms", newVLT);
+            return Long.parseLong(newVLT);
+        }
+        return 259200 * 1000; // 3 days
+    }
+
     private static boolean isInGossipStage()
     {
         return ((JMXEnabledSingleThreadExecutor) Stage.GOSSIP.executor()).isExecutedBy(Thread.currentThread());


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