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 2014/01/22 20:44:35 UTC
[1/6] git commit: Add properties to adjust FD initial value and max
interval Patch by brandonwilliams, reviewed by jbellis for CASSANDRA-4375
Updated Branches:
refs/heads/cassandra-1.2 3575fdccb -> c0c31ed0f
refs/heads/cassandra-2.0 e9a57fbaa -> 9c9881807
refs/heads/trunk 782273365 -> d86e1dd61
Add properties to adjust FD initial value and max interval
Patch by brandonwilliams, reviewed by jbellis for CASSANDRA-4375
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/c0c31ed0
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/c0c31ed0
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/c0c31ed0
Branch: refs/heads/cassandra-1.2
Commit: c0c31ed0f654da1a73aeae4e51440332495fdbec
Parents: 3575fdc
Author: Brandon Williams <br...@apache.org>
Authored: Wed Jan 22 13:36:44 2014 -0600
Committer: Brandon Williams <br...@apache.org>
Committed: Wed Jan 22 13:37:50 2014 -0600
----------------------------------------------------------------------
CHANGES.txt | 1 +
.../apache/cassandra/gms/FailureDetector.java | 30 ++++++++++++++++++--
2 files changed, 29 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/c0c31ed0/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 639e17c..524ffb7 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -14,6 +14,7 @@
* Paginate batchlog replay (CASSANDRA-6569)
* skip blocking on streaming during drain (CASSANDRA-6603)
* Improve error message when schema doesn't match loaded sstable (CASSANDRA-6262)
+ * Add properties to adjust FD initial value and max interval (CASSANDRA-4375)
1.2.13
http://git-wip-us.apache.org/repos/asf/cassandra/blob/c0c31ed0/src/java/org/apache/cassandra/gms/FailureDetector.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/gms/FailureDetector.java b/src/java/org/apache/cassandra/gms/FailureDetector.java
index ee47997..7a35c34 100644
--- a/src/java/org/apache/cassandra/gms/FailureDetector.java
+++ b/src/java/org/apache/cassandra/gms/FailureDetector.java
@@ -45,6 +45,7 @@ public class FailureDetector implements IFailureDetector, FailureDetectorMBean
{
public static final String MBEAN_NAME = "org.apache.cassandra.net:type=FailureDetector";
private static final int SAMPLE_SIZE = 1000;
+ protected static final int INITIAL_VALUE = getInitialValue();
public static final IFailureDetector instance = new FailureDetector();
private static final Logger logger = LoggerFactory.getLogger(FailureDetector.class);
@@ -72,6 +73,18 @@ public class FailureDetector implements IFailureDetector, FailureDetectorMBean
}
}
+ private static int getInitialValue()
+ {
+ String newvalue = System.getProperty("cassandra.fd_initial_value_ms");
+ if (newvalue != null)
+ {
+ logger.info("Overriding FD INITIAL_VALUE to {}ms", newvalue);
+ return Integer.parseInt(newvalue);
+ }
+ else
+ return Gossiper.intervalInMillis * 30;
+ }
+
public String getAllEndpointStates()
{
StringBuilder sb = new StringBuilder();
@@ -280,13 +293,26 @@ class ArrivalWindow
// in the event of a long partition, never record an interval longer than the rpc timeout,
// since if a host is regularly experiencing connectivity problems lasting this long we'd
// rather mark it down quickly instead of adapting
- private final double MAX_INTERVAL_IN_MS = DatabaseDescriptor.getRpcTimeout();
+ // this value defaults to the same initial value the FD is seeded with
+ private final int MAX_INTERVAL_IN_MS = getMaxInterval();
ArrivalWindow(int size)
{
arrivalIntervals = new BoundedStatsDeque(size);
}
+ private static int getMaxInterval()
+ {
+ String newvalue = System.getProperty("cassandra.fd_max_interval_ms");
+ if (newvalue != null)
+ {
+ logger.info("Overriding FD MAX_INTERVAL to {}ms", newvalue);
+ return Integer.parseInt(newvalue);
+ }
+ else
+ return FailureDetector.INITIAL_VALUE;
+ }
+
synchronized void add(double value)
{
if (tLast > 0L)
@@ -302,7 +328,7 @@ class ArrivalWindow
// We use a very large initial interval since the "right" average depends on the cluster size
// and it's better to err high (false negatives, which will be corrected by waiting a bit longer)
// than low (false positives, which cause "flapping").
- arrivalIntervals.add(Gossiper.intervalInMillis * 30);
+ arrivalIntervals.add(FailureDetector.INITIAL_VALUE);
}
tLast = value;
}
[5/6] git commit: Merge branch 'cassandra-1.2' into cassandra-2.0
Posted by br...@apache.org.
Merge branch 'cassandra-1.2' into cassandra-2.0
Conflicts:
src/java/org/apache/cassandra/gms/FailureDetector.java
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/9c988180
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/9c988180
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/9c988180
Branch: refs/heads/cassandra-2.0
Commit: 9c988180730a18a12f14f3868bf9cb6afced414a
Parents: e9a57fb c0c31ed
Author: Brandon Williams <br...@apache.org>
Authored: Wed Jan 22 13:42:30 2014 -0600
Committer: Brandon Williams <br...@apache.org>
Committed: Wed Jan 22 13:42:30 2014 -0600
----------------------------------------------------------------------
CHANGES.txt | 1 +
.../apache/cassandra/gms/FailureDetector.java | 30 ++++++++++++++++++--
2 files changed, 29 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/9c988180/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index b08f04b,524ffb7..6aa944d
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -18,29 -14,10 +18,30 @@@ Merged from 1.2
* Paginate batchlog replay (CASSANDRA-6569)
* skip blocking on streaming during drain (CASSANDRA-6603)
* Improve error message when schema doesn't match loaded sstable (CASSANDRA-6262)
+ * Add properties to adjust FD initial value and max interval (CASSANDRA-4375)
-1.2.13
+2.0.4
+ * Allow removing snapshots of no-longer-existing CFs (CASSANDRA-6418)
+ * add StorageService.stopDaemon() (CASSANDRA-4268)
+ * add IRE for invalid CF supplied to get_count (CASSANDRA-5701)
+ * add client encryption support to sstableloader (CASSANDRA-6378)
+ * Fix accept() loop for SSL sockets post-shutdown (CASSANDRA-6468)
+ * Fix size-tiered compaction in LCS L0 (CASSANDRA-6496)
+ * Fix assertion failure in filterColdSSTables (CASSANDRA-6483)
+ * Fix row tombstones in larger-than-memory compactions (CASSANDRA-6008)
+ * Fix cleanup ClassCastException (CASSANDRA-6462)
+ * Reduce gossip memory use by interning VersionedValue strings (CASSANDRA-6410)
+ * Allow specifying datacenters to participate in a repair (CASSANDRA-6218)
+ * Fix divide-by-zero in PCI (CASSANDRA-6403)
+ * Fix setting last compacted key in the wrong level for LCS (CASSANDRA-6284)
+ * Add millisecond precision formats to the timestamp parser (CASSANDRA-6395)
+ * Expose a total memtable size metric for a CF (CASSANDRA-6391)
+ * cqlsh: handle symlinks properly (CASSANDRA-6425)
+ * Fix potential infinite loop when paging query with IN (CASSANDRA-6464)
+ * Fix assertion error in AbstractQueryPager.discardFirst (CASSANDRA-6447)
+ * Fix streaming older SSTable yields unnecessary tombstones (CASSANDRA-6527)
+Merged from 1.2:
* Improved error message on bad properties in DDL queries (CASSANDRA-6453)
* Randomize batchlog candidates selection (CASSANDRA-6481)
* Fix thundering herd on endpoint cache invalidation (CASSANDRA-6345, 6485)
http://git-wip-us.apache.org/repos/asf/cassandra/blob/9c988180/src/java/org/apache/cassandra/gms/FailureDetector.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/gms/FailureDetector.java
index 4e5ba90,7a35c34..a7eb82f
--- a/src/java/org/apache/cassandra/gms/FailureDetector.java
+++ b/src/java/org/apache/cassandra/gms/FailureDetector.java
@@@ -288,20 -293,32 +301,33 @@@ class ArrivalWindo
// in the event of a long partition, never record an interval longer than the rpc timeout,
// since if a host is regularly experiencing connectivity problems lasting this long we'd
// rather mark it down quickly instead of adapting
- private final long MAX_INTERVAL_IN_NANO = DatabaseDescriptor.getRpcTimeout() * MILLI_TO_NANO;
+ // this value defaults to the same initial value the FD is seeded with
- private final int MAX_INTERVAL_IN_MS = getMaxInterval();
++ private final long MAX_INTERVAL_IN_NANO = getMaxInterval() * MILLI_TO_NANO;
ArrivalWindow(int size)
{
arrivalIntervals = new BoundedStatsDeque(size);
}
+ private static int getMaxInterval()
+ {
+ String newvalue = System.getProperty("cassandra.fd_max_interval_ms");
+ if (newvalue != null)
+ {
+ logger.info("Overriding FD MAX_INTERVAL to {}ms", newvalue);
+ return Integer.parseInt(newvalue);
+ }
+ else
+ return FailureDetector.INITIAL_VALUE;
+ }
+
- synchronized void add(double value)
+ synchronized void add(long value)
{
+ assert tLast >= 0;
if (tLast > 0L)
{
- double interArrivalTime = (value - tLast);
- if (interArrivalTime <= MAX_INTERVAL_IN_MS)
+ long interArrivalTime = (value - tLast);
+ if (interArrivalTime <= MAX_INTERVAL_IN_NANO)
arrivalIntervals.add(interArrivalTime);
else
logger.debug("Ignoring interval time of {}", interArrivalTime);
[3/6] git commit: Add properties to adjust FD initial value and max
interval Patch by brandonwilliams, reviewed by jbellis for CASSANDRA-4375
Posted by br...@apache.org.
Add properties to adjust FD initial value and max interval
Patch by brandonwilliams, reviewed by jbellis for CASSANDRA-4375
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/c0c31ed0
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/c0c31ed0
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/c0c31ed0
Branch: refs/heads/trunk
Commit: c0c31ed0f654da1a73aeae4e51440332495fdbec
Parents: 3575fdc
Author: Brandon Williams <br...@apache.org>
Authored: Wed Jan 22 13:36:44 2014 -0600
Committer: Brandon Williams <br...@apache.org>
Committed: Wed Jan 22 13:37:50 2014 -0600
----------------------------------------------------------------------
CHANGES.txt | 1 +
.../apache/cassandra/gms/FailureDetector.java | 30 ++++++++++++++++++--
2 files changed, 29 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/c0c31ed0/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 639e17c..524ffb7 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -14,6 +14,7 @@
* Paginate batchlog replay (CASSANDRA-6569)
* skip blocking on streaming during drain (CASSANDRA-6603)
* Improve error message when schema doesn't match loaded sstable (CASSANDRA-6262)
+ * Add properties to adjust FD initial value and max interval (CASSANDRA-4375)
1.2.13
http://git-wip-us.apache.org/repos/asf/cassandra/blob/c0c31ed0/src/java/org/apache/cassandra/gms/FailureDetector.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/gms/FailureDetector.java b/src/java/org/apache/cassandra/gms/FailureDetector.java
index ee47997..7a35c34 100644
--- a/src/java/org/apache/cassandra/gms/FailureDetector.java
+++ b/src/java/org/apache/cassandra/gms/FailureDetector.java
@@ -45,6 +45,7 @@ public class FailureDetector implements IFailureDetector, FailureDetectorMBean
{
public static final String MBEAN_NAME = "org.apache.cassandra.net:type=FailureDetector";
private static final int SAMPLE_SIZE = 1000;
+ protected static final int INITIAL_VALUE = getInitialValue();
public static final IFailureDetector instance = new FailureDetector();
private static final Logger logger = LoggerFactory.getLogger(FailureDetector.class);
@@ -72,6 +73,18 @@ public class FailureDetector implements IFailureDetector, FailureDetectorMBean
}
}
+ private static int getInitialValue()
+ {
+ String newvalue = System.getProperty("cassandra.fd_initial_value_ms");
+ if (newvalue != null)
+ {
+ logger.info("Overriding FD INITIAL_VALUE to {}ms", newvalue);
+ return Integer.parseInt(newvalue);
+ }
+ else
+ return Gossiper.intervalInMillis * 30;
+ }
+
public String getAllEndpointStates()
{
StringBuilder sb = new StringBuilder();
@@ -280,13 +293,26 @@ class ArrivalWindow
// in the event of a long partition, never record an interval longer than the rpc timeout,
// since if a host is regularly experiencing connectivity problems lasting this long we'd
// rather mark it down quickly instead of adapting
- private final double MAX_INTERVAL_IN_MS = DatabaseDescriptor.getRpcTimeout();
+ // this value defaults to the same initial value the FD is seeded with
+ private final int MAX_INTERVAL_IN_MS = getMaxInterval();
ArrivalWindow(int size)
{
arrivalIntervals = new BoundedStatsDeque(size);
}
+ private static int getMaxInterval()
+ {
+ String newvalue = System.getProperty("cassandra.fd_max_interval_ms");
+ if (newvalue != null)
+ {
+ logger.info("Overriding FD MAX_INTERVAL to {}ms", newvalue);
+ return Integer.parseInt(newvalue);
+ }
+ else
+ return FailureDetector.INITIAL_VALUE;
+ }
+
synchronized void add(double value)
{
if (tLast > 0L)
@@ -302,7 +328,7 @@ class ArrivalWindow
// We use a very large initial interval since the "right" average depends on the cluster size
// and it's better to err high (false negatives, which will be corrected by waiting a bit longer)
// than low (false positives, which cause "flapping").
- arrivalIntervals.add(Gossiper.intervalInMillis * 30);
+ arrivalIntervals.add(FailureDetector.INITIAL_VALUE);
}
tLast = value;
}
[4/6] git commit: Merge branch 'cassandra-1.2' into cassandra-2.0
Posted by br...@apache.org.
Merge branch 'cassandra-1.2' into cassandra-2.0
Conflicts:
src/java/org/apache/cassandra/gms/FailureDetector.java
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/9c988180
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/9c988180
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/9c988180
Branch: refs/heads/trunk
Commit: 9c988180730a18a12f14f3868bf9cb6afced414a
Parents: e9a57fb c0c31ed
Author: Brandon Williams <br...@apache.org>
Authored: Wed Jan 22 13:42:30 2014 -0600
Committer: Brandon Williams <br...@apache.org>
Committed: Wed Jan 22 13:42:30 2014 -0600
----------------------------------------------------------------------
CHANGES.txt | 1 +
.../apache/cassandra/gms/FailureDetector.java | 30 ++++++++++++++++++--
2 files changed, 29 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/9c988180/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index b08f04b,524ffb7..6aa944d
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -18,29 -14,10 +18,30 @@@ Merged from 1.2
* Paginate batchlog replay (CASSANDRA-6569)
* skip blocking on streaming during drain (CASSANDRA-6603)
* Improve error message when schema doesn't match loaded sstable (CASSANDRA-6262)
+ * Add properties to adjust FD initial value and max interval (CASSANDRA-4375)
-1.2.13
+2.0.4
+ * Allow removing snapshots of no-longer-existing CFs (CASSANDRA-6418)
+ * add StorageService.stopDaemon() (CASSANDRA-4268)
+ * add IRE for invalid CF supplied to get_count (CASSANDRA-5701)
+ * add client encryption support to sstableloader (CASSANDRA-6378)
+ * Fix accept() loop for SSL sockets post-shutdown (CASSANDRA-6468)
+ * Fix size-tiered compaction in LCS L0 (CASSANDRA-6496)
+ * Fix assertion failure in filterColdSSTables (CASSANDRA-6483)
+ * Fix row tombstones in larger-than-memory compactions (CASSANDRA-6008)
+ * Fix cleanup ClassCastException (CASSANDRA-6462)
+ * Reduce gossip memory use by interning VersionedValue strings (CASSANDRA-6410)
+ * Allow specifying datacenters to participate in a repair (CASSANDRA-6218)
+ * Fix divide-by-zero in PCI (CASSANDRA-6403)
+ * Fix setting last compacted key in the wrong level for LCS (CASSANDRA-6284)
+ * Add millisecond precision formats to the timestamp parser (CASSANDRA-6395)
+ * Expose a total memtable size metric for a CF (CASSANDRA-6391)
+ * cqlsh: handle symlinks properly (CASSANDRA-6425)
+ * Fix potential infinite loop when paging query with IN (CASSANDRA-6464)
+ * Fix assertion error in AbstractQueryPager.discardFirst (CASSANDRA-6447)
+ * Fix streaming older SSTable yields unnecessary tombstones (CASSANDRA-6527)
+Merged from 1.2:
* Improved error message on bad properties in DDL queries (CASSANDRA-6453)
* Randomize batchlog candidates selection (CASSANDRA-6481)
* Fix thundering herd on endpoint cache invalidation (CASSANDRA-6345, 6485)
http://git-wip-us.apache.org/repos/asf/cassandra/blob/9c988180/src/java/org/apache/cassandra/gms/FailureDetector.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/gms/FailureDetector.java
index 4e5ba90,7a35c34..a7eb82f
--- a/src/java/org/apache/cassandra/gms/FailureDetector.java
+++ b/src/java/org/apache/cassandra/gms/FailureDetector.java
@@@ -288,20 -293,32 +301,33 @@@ class ArrivalWindo
// in the event of a long partition, never record an interval longer than the rpc timeout,
// since if a host is regularly experiencing connectivity problems lasting this long we'd
// rather mark it down quickly instead of adapting
- private final long MAX_INTERVAL_IN_NANO = DatabaseDescriptor.getRpcTimeout() * MILLI_TO_NANO;
+ // this value defaults to the same initial value the FD is seeded with
- private final int MAX_INTERVAL_IN_MS = getMaxInterval();
++ private final long MAX_INTERVAL_IN_NANO = getMaxInterval() * MILLI_TO_NANO;
ArrivalWindow(int size)
{
arrivalIntervals = new BoundedStatsDeque(size);
}
+ private static int getMaxInterval()
+ {
+ String newvalue = System.getProperty("cassandra.fd_max_interval_ms");
+ if (newvalue != null)
+ {
+ logger.info("Overriding FD MAX_INTERVAL to {}ms", newvalue);
+ return Integer.parseInt(newvalue);
+ }
+ else
+ return FailureDetector.INITIAL_VALUE;
+ }
+
- synchronized void add(double value)
+ synchronized void add(long value)
{
+ assert tLast >= 0;
if (tLast > 0L)
{
- double interArrivalTime = (value - tLast);
- if (interArrivalTime <= MAX_INTERVAL_IN_MS)
+ long interArrivalTime = (value - tLast);
+ if (interArrivalTime <= MAX_INTERVAL_IN_NANO)
arrivalIntervals.add(interArrivalTime);
else
logger.debug("Ignoring interval time of {}", interArrivalTime);
[6/6] git commit: Merge branch 'cassandra-2.0' into trunk
Posted by br...@apache.org.
Merge branch 'cassandra-2.0' into trunk
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/d86e1dd6
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/d86e1dd6
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/d86e1dd6
Branch: refs/heads/trunk
Commit: d86e1dd61df7475501e3ab41bdb9a79002fa2ebc
Parents: 7822733 9c98818
Author: Brandon Williams <br...@apache.org>
Authored: Wed Jan 22 13:42:39 2014 -0600
Committer: Brandon Williams <br...@apache.org>
Committed: Wed Jan 22 13:42:39 2014 -0600
----------------------------------------------------------------------
CHANGES.txt | 1 +
.../apache/cassandra/gms/FailureDetector.java | 30 ++++++++++++++++++--
2 files changed, 29 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/d86e1dd6/CHANGES.txt
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/d86e1dd6/src/java/org/apache/cassandra/gms/FailureDetector.java
----------------------------------------------------------------------
[2/6] git commit: Add properties to adjust FD initial value and max
interval Patch by brandonwilliams, reviewed by jbellis for CASSANDRA-4375
Posted by br...@apache.org.
Add properties to adjust FD initial value and max interval
Patch by brandonwilliams, reviewed by jbellis for CASSANDRA-4375
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/c0c31ed0
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/c0c31ed0
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/c0c31ed0
Branch: refs/heads/cassandra-2.0
Commit: c0c31ed0f654da1a73aeae4e51440332495fdbec
Parents: 3575fdc
Author: Brandon Williams <br...@apache.org>
Authored: Wed Jan 22 13:36:44 2014 -0600
Committer: Brandon Williams <br...@apache.org>
Committed: Wed Jan 22 13:37:50 2014 -0600
----------------------------------------------------------------------
CHANGES.txt | 1 +
.../apache/cassandra/gms/FailureDetector.java | 30 ++++++++++++++++++--
2 files changed, 29 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/c0c31ed0/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 639e17c..524ffb7 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -14,6 +14,7 @@
* Paginate batchlog replay (CASSANDRA-6569)
* skip blocking on streaming during drain (CASSANDRA-6603)
* Improve error message when schema doesn't match loaded sstable (CASSANDRA-6262)
+ * Add properties to adjust FD initial value and max interval (CASSANDRA-4375)
1.2.13
http://git-wip-us.apache.org/repos/asf/cassandra/blob/c0c31ed0/src/java/org/apache/cassandra/gms/FailureDetector.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/gms/FailureDetector.java b/src/java/org/apache/cassandra/gms/FailureDetector.java
index ee47997..7a35c34 100644
--- a/src/java/org/apache/cassandra/gms/FailureDetector.java
+++ b/src/java/org/apache/cassandra/gms/FailureDetector.java
@@ -45,6 +45,7 @@ public class FailureDetector implements IFailureDetector, FailureDetectorMBean
{
public static final String MBEAN_NAME = "org.apache.cassandra.net:type=FailureDetector";
private static final int SAMPLE_SIZE = 1000;
+ protected static final int INITIAL_VALUE = getInitialValue();
public static final IFailureDetector instance = new FailureDetector();
private static final Logger logger = LoggerFactory.getLogger(FailureDetector.class);
@@ -72,6 +73,18 @@ public class FailureDetector implements IFailureDetector, FailureDetectorMBean
}
}
+ private static int getInitialValue()
+ {
+ String newvalue = System.getProperty("cassandra.fd_initial_value_ms");
+ if (newvalue != null)
+ {
+ logger.info("Overriding FD INITIAL_VALUE to {}ms", newvalue);
+ return Integer.parseInt(newvalue);
+ }
+ else
+ return Gossiper.intervalInMillis * 30;
+ }
+
public String getAllEndpointStates()
{
StringBuilder sb = new StringBuilder();
@@ -280,13 +293,26 @@ class ArrivalWindow
// in the event of a long partition, never record an interval longer than the rpc timeout,
// since if a host is regularly experiencing connectivity problems lasting this long we'd
// rather mark it down quickly instead of adapting
- private final double MAX_INTERVAL_IN_MS = DatabaseDescriptor.getRpcTimeout();
+ // this value defaults to the same initial value the FD is seeded with
+ private final int MAX_INTERVAL_IN_MS = getMaxInterval();
ArrivalWindow(int size)
{
arrivalIntervals = new BoundedStatsDeque(size);
}
+ private static int getMaxInterval()
+ {
+ String newvalue = System.getProperty("cassandra.fd_max_interval_ms");
+ if (newvalue != null)
+ {
+ logger.info("Overriding FD MAX_INTERVAL to {}ms", newvalue);
+ return Integer.parseInt(newvalue);
+ }
+ else
+ return FailureDetector.INITIAL_VALUE;
+ }
+
synchronized void add(double value)
{
if (tLast > 0L)
@@ -302,7 +328,7 @@ class ArrivalWindow
// We use a very large initial interval since the "right" average depends on the cluster size
// and it's better to err high (false negatives, which will be corrected by waiting a bit longer)
// than low (false positives, which cause "flapping").
- arrivalIntervals.add(Gossiper.intervalInMillis * 30);
+ arrivalIntervals.add(FailureDetector.INITIAL_VALUE);
}
tLast = value;
}