Merge branch 'cassandra-2.1' into cassandra-2.2 Conflicts: CHANGES.txt conf/cassandra.yaml src/java/org/apache/cassandra/config/DatabaseDescriptor.java src/java/org/apache/cassandra/service/GCInspector.java
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/53d04491 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/53d04491 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/53d04491 Branch: refs/heads/cassandra-3.0 Commit: 53d04491707a2bd6cde48524a381361e67c054df Parents: 0d5908b 488db6f Author: Joshua McKenzie <jmcken...@apache.org> Authored: Fri Sep 11 13:00:40 2015 -0400 Committer: Joshua McKenzie <jmcken...@apache.org> Committed: Fri Sep 11 13:00:40 2015 -0400 ---------------------------------------------------------------------- CHANGES.txt | 1 + conf/cassandra.yaml | 5 +++++ src/java/org/apache/cassandra/config/Config.java | 2 ++ .../apache/cassandra/config/DatabaseDescriptor.java | 11 +++++++++++ .../org/apache/cassandra/service/GCInspector.java | 16 +++++++++++----- 5 files changed, 30 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/53d04491/CHANGES.txt ---------------------------------------------------------------------- diff --cc CHANGES.txt index cd29592,4e0df42..ffae4d9 --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,15 -1,6 +1,16 @@@ -2.1.10 +2.2.2 + * Defer default role manager setup until all nodes are on 2.2+ (CASSANDRA-9761) + * Cancel transaction for sstables we wont redistribute index summary + for (CASSANDRA-10270) + * Handle missing RoleManager in config after upgrade to 2.2 (CASSANDRA-10209) + * Retry snapshot deletion after compaction and gc on Windows (CASSANDRA-10222) + * Fix failure to start with space in directory path on Windows (CASSANDRA-10239) + * Fix repair hang when snapshot failed (CASSANDRA-10057) + * Fall back to 1/4 commitlog volume for commitlog_total_space on small disks + (CASSANDRA-10199) +Merged from 2.1: + * Added configurable warning threshold for GC duration (CASSANDRA-8907) - * (cqlsh) Make cqlsh PEP8 compliant (CASSANDRA-10066) + * (cqlsh) Make cqlsh PEP8 Compliant (CASSANDRA-10066) * (cqlsh) Fix error when starting cqlsh with --debug (CASSANDRA-10282) * Scrub, Cleanup and Upgrade do not unmark compacting until all operations have completed, regardless of the occurence of exceptions (CASSANDRA-10274) http://git-wip-us.apache.org/repos/asf/cassandra/blob/53d04491/conf/cassandra.yaml ---------------------------------------------------------------------- diff --cc conf/cassandra.yaml index 4ff7afb,7e266d1..ab8e8d1 --- a/conf/cassandra.yaml +++ b/conf/cassandra.yaml @@@ -849,20 -803,7 +849,25 @@@ internode_compression: al # latency if you block for cross-datacenter responses. inter_dc_tcp_nodelay: false +# TTL for different trace types used during logging of the repair process. +tracetype_query_ttl: 86400 +tracetype_repair_ttl: 604800 + + # GC Pauses greater than gc_warn_threshold_in_ms will be logged at WARN level + # Adjust the threshold based on your application throughput requirement + # By default, Cassandra logs GC Pauses greater than 200 ms at INFO level + # gc_warn_threshold_in_ms: 1000 ++ +# UDFs (user defined functions) are disabled by default. +# As of Cassandra 2.2, there is no security manager or anything else in place that +# prevents execution of evil code. CASSANDRA-9402 will fix this issue for Cassandra 3.0. +# This will inherently be backwards-incompatible with any 2.2 UDF that perform insecure +# operations such as opening a socket or writing to the filesystem. +enable_user_defined_functions: false + +# The default Windows kernel timer and scheduling resolution is 15.6ms for power conservation. +# Lowering this value on Windows can provide much tighter latency and better throughput, however +# some virtualized environments may see a negative performance impact from changing this setting +# below their system default. The sysinternals 'clockres' tool can confirm your system's default +# setting. +windows_timer_interval: 1 http://git-wip-us.apache.org/repos/asf/cassandra/blob/53d04491/src/java/org/apache/cassandra/config/Config.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/53d04491/src/java/org/apache/cassandra/config/DatabaseDescriptor.java ---------------------------------------------------------------------- diff --cc src/java/org/apache/cassandra/config/DatabaseDescriptor.java index 423185b,3a6a8fd..545ad05 --- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java +++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java @@@ -358,9 -389,14 +358,14 @@@ public class DatabaseDescripto } paritionerName = partitioner.getClass().getCanonicalName(); + if (conf.gc_warn_threshold_in_ms < 0) + { + throw new ConfigurationException("gc_warn_threshold_in_ms must be a positive integer"); + } + if (conf.max_hint_window_in_ms == null) { - throw new ConfigurationException("max_hint_window_in_ms cannot be set to null"); + throw new ConfigurationException("max_hint_window_in_ms cannot be set to null", false); } /* phi convict threshold for FailureDetector */ @@@ -1770,13 -1713,9 +1775,19 @@@ return conf.otc_coalescing_window_us; } + public static boolean enableUserDefinedFunctions() + { + return conf.enable_user_defined_functions; + } + + public static int getWindowsTimerInterval() + { + return conf.windows_timer_interval; + } ++ + public static long getGCWarnThreshold() + { + return conf.gc_warn_threshold_in_ms; + } + } http://git-wip-us.apache.org/repos/asf/cassandra/blob/53d04491/src/java/org/apache/cassandra/service/GCInspector.java ---------------------------------------------------------------------- diff --cc src/java/org/apache/cassandra/service/GCInspector.java index 4e03a49,cf17a34..3a4ec22 --- a/src/java/org/apache/cassandra/service/GCInspector.java +++ b/src/java/org/apache/cassandra/service/GCInspector.java @@@ -36,9 -38,7 +39,8 @@@ import com.sun.management.GcInfo import org.slf4j.Logger; import org.slf4j.LoggerFactory; - import com.sun.management.GarbageCollectionNotificationInfo; - import com.sun.management.GcInfo; + import org.apache.cassandra.config.DatabaseDescriptor; + import org.apache.cassandra.io.sstable.SSTableDeletingTask; import org.apache.cassandra.utils.StatusLogger; @@@ -47,31 -47,9 +49,33 @@@ public class GCInspector implements Not public static final String MBEAN_NAME = "org.apache.cassandra.service:type=GCInspector"; private static final Logger logger = LoggerFactory.getLogger(GCInspector.class); final static long MIN_LOG_DURATION = 200; - final static long MIN_LOG_DURATION_TPSTATS = 1000; + final static long GC_WARN_THRESHOLD_IN_MS = DatabaseDescriptor.getGCWarnThreshold(); + final static long STAT_THRESHOLD = Math.min(GC_WARN_THRESHOLD_IN_MS != 0 ? GC_WARN_THRESHOLD_IN_MS : MIN_LOG_DURATION, MIN_LOG_DURATION); + + /* + * The field from java.nio.Bits that tracks the total number of allocated + * bytes of direct memory requires via ByteBuffer.allocateDirect that have not been GCed. + */ + final static Field BITS_TOTAL_CAPACITY; + + static + { + Field temp = null; + try + { + Class<?> bitsClass = Class.forName("java.nio.Bits"); + Field f = bitsClass.getDeclaredField("totalCapacity"); + f.setAccessible(true); + temp = f; + } + catch (Throwable t) + { + logger.debug("Error accessing field of java.nio.Bits", t); + //Don't care, will just return the dummy value -1 if we can't get at the field in this JVM + } + BITS_TOTAL_CAPACITY = temp; + } + static final class State { final double maxRealTimeElapsed;