You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by sn...@apache.org on 2015/11/04 23:32:49 UTC

[1/3] cassandra git commit: get JEMAlloc debug output out of nodetool output

Repository: cassandra
Updated Branches:
  refs/heads/trunk 1b876bc60 -> be2cf1afa


get JEMAlloc debug output out of nodetool output

patch by Robert Stupp; reviewed by Ariel Weisberg for CASSANDRA-10628


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

Branch: refs/heads/trunk
Commit: 0ff13d2a6847f7ecba1ac9a26b66714d9e58b60d
Parents: a306a1b
Author: Robert Stupp <sn...@snazy.de>
Authored: Wed Nov 4 23:28:57 2015 +0100
Committer: Robert Stupp <sn...@snazy.de>
Committed: Wed Nov 4 23:28:57 2015 +0100

----------------------------------------------------------------------
 CHANGES.txt                                     |  2 +-
 bin/cassandra                                   | 49 ++++++++++++++++++++
 conf/cassandra-env.sh                           | 49 --------------------
 .../apache/cassandra/service/StartupChecks.java | 19 +++++++-
 4 files changed, 68 insertions(+), 51 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/0ff13d2a/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 60bf565..fedede2 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,5 +1,5 @@
 2.2.4
- * Deprecate memory_allocator in cassandra.yaml (CASSANDRA-10581)
+ * Deprecate memory_allocator in cassandra.yaml (CASSANDRA-10581,10628)
  * Expose phi values from failure detector via JMX and tweak debug
    and trace logging (CASSANDRA-9526)
  * Fix RangeNamesQueryPager (CASSANDRA-10509)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0ff13d2a/bin/cassandra
----------------------------------------------------------------------
diff --git a/bin/cassandra b/bin/cassandra
index 8d7b14f..0bbd9fb 100755
--- a/bin/cassandra
+++ b/bin/cassandra
@@ -132,6 +132,55 @@ case "`uname`" in
     ;;
 esac
 
+# Cassandra uses an installed jemalloc via LD_PRELOAD / DYLD_INSERT_LIBRARIES by default to improve off-heap
+# memory allocation performance. The following code searches for an installed libjemalloc.dylib/.so/.1.so using
+# Linux and OS-X specific approaches.
+# To specify your own libjemalloc in a different path, configure the fully qualified path in CASSANDRA_LIBJEMALLOC.
+# To disable jemalloc preload at all, set CASSANDRA_LIBJEMALLOC=-
+#
+#CASSANDRA_LIBJEMALLOC=
+#
+find_library()
+{
+    pattern=$1
+    path=$(echo ${2} | tr ":" " ")
+
+    find $path -regex "$pattern" -print 2>/dev/null | head -n 1
+}
+case "`uname -s`" in
+    Linux)
+        if [ -z $CASSANDRA_LIBJEMALLOC ] ; then
+            which ldconfig > /dev/null 2>&1
+            if [ $? = 0 ] ; then
+                # e.g. for CentOS
+                dirs="/lib64 /lib /usr/lib64 /usr/lib `ldconfig -v 2>/dev/null | grep -v ^$'\t' | sed 's/^\([^:]*\):.*$/\1/'`"
+            else
+                # e.g. for Debian, OpenSUSE
+                dirs="/lib64 /lib /usr/lib64 /usr/lib `cat /etc/ld.so.conf /etc/ld.so.conf.d/*.conf | grep '^/'`"
+            fi
+            dirs=`echo $dirs | tr " " ":"`
+            CASSANDRA_LIBJEMALLOC=$(find_library '.*/libjemalloc\.so\(\.1\)*' $dirs)
+        fi
+        if [ ! -z $CASSANDRA_LIBJEMALLOC ] ; then
+            export JVM_OPTS="$JVM_OPTS -Dcassandra.libjemalloc=$CASSANDRA_LIBJEMALLOC"
+            if [ "-" != "$CASSANDRA_LIBJEMALLOC" ] ; then
+                export LD_PRELOAD=$CASSANDRA_LIBJEMALLOC
+            fi
+        fi
+    ;;
+    Darwin)
+        if [ -z $CASSANDRA_LIBJEMALLOC ] ; then
+            CASSANDRA_LIBJEMALLOC=$(find_library '.*/libjemalloc\.dylib' $DYLD_LIBRARY_PATH:${DYLD_FALLBACK_LIBRARY_PATH-$HOME/lib:/usr/local/lib:/lib:/usr/lib})
+        fi
+        if [ ! -z $CASSANDRA_LIBJEMALLOC ] ; then
+            export JVM_OPTS="$JVM_OPTS -Dcassandra.libjemalloc=$CASSANDRA_LIBJEMALLOC"
+            if [ "-" != "$CASSANDRA_LIBJEMALLOC" ] ; then
+                export DYLD_INSERT_LIBRARIES=$CASSANDRA_LIBJEMALLOC
+            fi
+        fi
+    ;;
+esac
+
 launch_service()
 {
     pidpath="$1"

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0ff13d2a/conf/cassandra-env.sh
----------------------------------------------------------------------
diff --git a/conf/cassandra-env.sh b/conf/cassandra-env.sh
index bb20964..e82198b 100644
--- a/conf/cassandra-env.sh
+++ b/conf/cassandra-env.sh
@@ -160,55 +160,6 @@ then
     export MALLOC_ARENA_MAX=4
 fi
 
-# Cassandra uses an installed jemalloc via LD_PRELOAD / DYLD_INSERT_LIBRARIES by default to improve off-heap
-# memory allocation performance. The following code searches for an installed libjemalloc.dylib/.so/.1.so using
-# Linux and OS-X specific approaches.
-# To specify your own libjemalloc in a different path, configure the fully qualified path in CASSANDRA_LIBJEMALLOC.
-# To disable jemalloc at all set CASSANDRA_LIBJEMALLOC=-
-#
-#CASSANDRA_LIBJEMALLOC=
-#
-find_library()
-{
-    pattern=$1
-    path=$(echo ${2} | tr ":" " ")
-
-    find $path -regex "$pattern" -print 2>/dev/null | head -n 1
-}
-case "`uname -s`" in
-    Linux)
-        if [ -z $CASSANDRA_LIBJEMALLOC ] ; then
-            which ldconfig > /dev/null 2>&1
-            if [ $? = 0 ] ; then
-                # e.g. for CentOS
-                dirs="/lib64 /lib /usr/lib64 /usr/lib `ldconfig -v 2>/dev/null | grep -v ^$'\t' | sed 's/^\([^:]*\):.*$/\1/'`"
-            else
-                # e.g. for Debian, OpenSUSE
-                dirs="/lib64 /lib /usr/lib64 /usr/lib `cat /etc/ld.so.conf /etc/ld.so.conf.d/*.conf | grep '^/'`"
-            fi
-            dirs=`echo $dirs | tr " " ":"`
-            CASSANDRA_LIBJEMALLOC=$(find_library '.*/libjemalloc\.so\(\.1\)*' $dirs)
-        fi
-        if [ ! -z $CASSANDRA_LIBJEMALLOC ] && [ "-" != "$CASSANDRA_LIBJEMALLOC" ] ; then
-            echo "INFO preloading $CASSANDRA_LIBJEMALLOC"
-            export LD_PRELOAD=$CASSANDRA_LIBJEMALLOC
-        else
-            echo "WARNING could not find libjemalloc.dylib, please install for better performance - search path: $dirs"
-        fi
-    ;;
-    Darwin)
-        if [ -z $CASSANDRA_LIBJEMALLOC ] ; then
-            CASSANDRA_LIBJEMALLOC=$(find_library '.*/libjemalloc\.dylib' $DYLD_LIBRARY_PATH:${DYLD_FALLBACK_LIBRARY_PATH-$HOME/lib:/usr/local/lib:/lib:/usr/lib})
-        fi
-        if [ ! -z $CASSANDRA_LIBJEMALLOC ] && [ "-" != "$CASSANDRA_LIBJEMALLOC" ] ; then
-            echo "INFO preloading $CASSANDRA_LIBJEMALLOC"
-            export DYLD_INSERT_LIBRARIES=$CASSANDRA_LIBJEMALLOC
-        else
-            echo "WARNING could not find libjemalloc.dylib, please install for better performance - search path: $DYLD_LIBRARY_PATH:${DYLD_FALLBACK_LIBRARY_PATH-$HOME/lib:/usr/local/lib:/lib:/usr/lib}"
-        fi
-    ;;
-esac
-
 
 # Specifies the default port over which Cassandra will be available for
 # JMX connections.

http://git-wip-us.apache.org/repos/asf/cassandra/blob/0ff13d2a/src/java/org/apache/cassandra/service/StartupChecks.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/StartupChecks.java b/src/java/org/apache/cassandra/service/StartupChecks.java
index 4934dea..8b8810c 100644
--- a/src/java/org/apache/cassandra/service/StartupChecks.java
+++ b/src/java/org/apache/cassandra/service/StartupChecks.java
@@ -67,7 +67,8 @@ public class StartupChecks
     // The default set of pre-flight checks to run. Order is somewhat significant in that we probably
     // always want the system keyspace check run last, as this actually loads the schema for that
     // keyspace. All other checks should not require any schema initialization.
-    private final List<StartupCheck> DEFAULT_TESTS = ImmutableList.of(checkValidLaunchDate,
+    private final List<StartupCheck> DEFAULT_TESTS = ImmutableList.of(checkJemalloc,
+                                                                      checkValidLaunchDate,
                                                                       checkJMXPorts,
                                                                       inspectJvmOptions,
                                                                       checkJnaInitialization,
@@ -103,6 +104,22 @@ public class StartupChecks
             test.execute();
     }
 
+    public static final StartupCheck checkJemalloc = new StartupCheck()
+    {
+        public void execute() throws StartupException
+        {
+            if (FBUtilities.isWindows())
+                return;
+            String jemalloc = System.getProperty("cassandra.libjemalloc");
+            if (jemalloc == null)
+                logger.warn("jemalloc shared library could not be preloaded to speed up memory allocations");
+            else if ("-".equals(jemalloc))
+                logger.info("jemalloc preload explicitly disabled");
+            else
+                logger.info("jemalloc seems to be preloaded from {}", jemalloc);
+        }
+    };
+
     public static final StartupCheck checkValidLaunchDate = new StartupCheck()
     {
         /**


[3/3] cassandra git commit: Merge branch 'cassandra-3.0' into trunk

Posted by sn...@apache.org.
Merge branch 'cassandra-3.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/be2cf1af
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/be2cf1af
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/be2cf1af

Branch: refs/heads/trunk
Commit: be2cf1afa75acfe9c2ce385a69f471d4770c56bb
Parents: 1b876bc 242b973
Author: Robert Stupp <sn...@snazy.de>
Authored: Wed Nov 4 23:30:01 2015 +0100
Committer: Robert Stupp <sn...@snazy.de>
Committed: Wed Nov 4 23:30:01 2015 +0100

----------------------------------------------------------------------
 CHANGES.txt                                     |  2 +-
 bin/cassandra                                   | 49 ++++++++++++++++++++
 conf/cassandra-env.sh                           | 49 --------------------
 .../apache/cassandra/service/StartupChecks.java | 19 +++++++-
 4 files changed, 68 insertions(+), 51 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/be2cf1af/CHANGES.txt
----------------------------------------------------------------------


[2/3] cassandra git commit: Merge branch 'cassandra-2.2' into cassandra-3.0

Posted by sn...@apache.org.
Merge branch 'cassandra-2.2' into cassandra-3.0


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

Branch: refs/heads/trunk
Commit: 242b9738f21e835c3f0cb734c96947c4e4ed0710
Parents: 340df43 0ff13d2
Author: Robert Stupp <sn...@snazy.de>
Authored: Wed Nov 4 23:29:44 2015 +0100
Committer: Robert Stupp <sn...@snazy.de>
Committed: Wed Nov 4 23:29:44 2015 +0100

----------------------------------------------------------------------
 CHANGES.txt                                     |  2 +-
 bin/cassandra                                   | 49 ++++++++++++++++++++
 conf/cassandra-env.sh                           | 49 --------------------
 .../apache/cassandra/service/StartupChecks.java | 19 +++++++-
 4 files changed, 68 insertions(+), 51 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/242b9738/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 1914fa1,fedede2..5fdeae5
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,29 -1,10 +1,29 @@@
 -2.2.4
 - * Deprecate memory_allocator in cassandra.yaml (CASSANDRA-10581,10628)
 +3.0
 + * Use CQL type names in schema metadata tables (CASSANDRA-10365)
 + * Guard batchlog replay against integer division by zero (CASSANDRA-9223)
 + * Fix bug when adding a column to thrift with the same name than a primary key (CASSANDRA-10608)
 + * Add client address argument to IAuthenticator::newSaslNegotiator (CASSANDRA-8068)
 + * Fix implementation of LegacyLayout.LegacyBoundComparator (CASSANDRA-10602)
 + * Don't use 'names query' read path for counters (CASSANDRA-10572)
 + * Fix backward compatibility for counters (CASSANDRA-10470)
-  * Remove memory_allocator paramter from cassandra.yaml (CASSANDRA-10581)
++ * Remove memory_allocator paramter from cassandra.yaml (CASSANDRA-10581,10628)
 + * Execute the metadata reload task of all registered indexes on CFS::reload (CASSANDRA-10604)
 + * Fix thrift cas operations with defined columns (CASSANDRA-10576)
 + * Fix PartitionUpdate.operationCount()for updates with static column operations (CASSANDRA-10606)
 + * Fix thrift get() queries with defined columns (CASSANDRA-10586)
 + * Fix marking of indexes as built and removed (CASSANDRA-10601)
 + * Skip initialization of non-registered 2i instances, remove Index::getIndexName (CASSANDRA-10595)
 + * Fix batches on multiple tables (CASSANDRA-10554)
 + * Ensure compaction options are validated when updating KeyspaceMetadata (CASSANDRA-10569)
 + * Flatten Iterator Transformation Hierarchy (CASSANDRA-9975)
 + * Remove token generator (CASSANDRA-5261)
 + * RolesCache should not be created for any authenticator that does not requireAuthentication (CASSANDRA-10562)
 + * Fix LogTransaction checking only a single directory for files (CASSANDRA-10421)
 + * Fix handling of range tombstones when reading old format sstables (CASSANDRA-10360)
 + * Aggregate with Initial Condition fails with C* 3.0 (CASSANDRA-10367)
 +Merged from 2.2:
   * Expose phi values from failure detector via JMX and tweak debug
     and trace logging (CASSANDRA-9526)
 - * Fix RangeNamesQueryPager (CASSANDRA-10509)
 - * Deprecate Pig support (CASSANDRA-10542)
 - * Reduce contention getting instances of CompositeType (CASSANDRA-10433)
  Merged from 2.1:
   * Improve handling of dead nodes in gossip (CASSANDRA-10298)
   * Fix logback-tools.xml incorrectly configured for outputing to System.err

http://git-wip-us.apache.org/repos/asf/cassandra/blob/242b9738/conf/cassandra-env.sh
----------------------------------------------------------------------
diff --cc conf/cassandra-env.sh
index 2f0ae34,e82198b..ef164e8
--- a/conf/cassandra-env.sh
+++ b/conf/cassandra-env.sh
@@@ -156,98 -160,15 +156,49 @@@ if [ "x$MALLOC_ARENA_MAX" = "x" ] ; the
      export MALLOC_ARENA_MAX=4
  fi
  
- # Cassandra uses an installed jemalloc via LD_PRELOAD / DYLD_INSERT_LIBRARIES by default to improve off-heap
- # memory allocation performance. The following code searches for an installed libjemalloc.dylib/.so/.1.so using
- # Linux and OS-X specific approaches.
- # To specify your own libjemalloc in a different path, configure the fully qualified path in CASSANDRA_LIBJEMALLOC.
- # To disable jemalloc at all set CASSANDRA_LIBJEMALLOC=-
- #
- #CASSANDRA_LIBJEMALLOC=
- #
- find_library()
- {
-     pattern=$1
-     path=$(echo ${2} | tr ":" " ")
- 
-     find $path -regex "$pattern" -print 2>/dev/null | head -n 1
- }
- case "`uname -s`" in
-     Linux)
-         if [ -z $CASSANDRA_LIBJEMALLOC ] ; then
-             which ldconfig > /dev/null 2>&1
-             if [ $? = 0 ] ; then
-                 # e.g. for CentOS
-                 dirs="/lib64 /lib /usr/lib64 /usr/lib `ldconfig -v 2>/dev/null | grep -v ^$'\t' | sed 's/^\([^:]*\):.*$/\1/'`"
-             else
-                 # e.g. for Debian, OpenSUSE
-                 dirs="/lib64 /lib /usr/lib64 /usr/lib `cat /etc/ld.so.conf /etc/ld.so.conf.d/*.conf | grep '^/'`"
-             fi
-             dirs=`echo $dirs | tr " " ":"`
-             CASSANDRA_LIBJEMALLOC=$(find_library '.*/libjemalloc\.so\(\.1\)*' $dirs)
-         fi
-         if [ ! -z $CASSANDRA_LIBJEMALLOC ] && [ "-" != "$CASSANDRA_LIBJEMALLOC" ] ; then
-             echo "INFO preloading $CASSANDRA_LIBJEMALLOC"
-             export LD_PRELOAD=$CASSANDRA_LIBJEMALLOC
-         else
-             echo "WARNING could not find libjemalloc.dylib, please install for better performance - search path: $dirs"
-         fi
-     ;;
-     Darwin)
-         if [ -z $CASSANDRA_LIBJEMALLOC ] ; then
-             CASSANDRA_LIBJEMALLOC=$(find_library '.*/libjemalloc\.dylib' $DYLD_LIBRARY_PATH:${DYLD_FALLBACK_LIBRARY_PATH-$HOME/lib:/usr/local/lib:/lib:/usr/lib})
-         fi
-         if [ ! -z $CASSANDRA_LIBJEMALLOC ] && [ "-" != "$CASSANDRA_LIBJEMALLOC" ] ; then
-             echo "INFO preloading $CASSANDRA_LIBJEMALLOC"
-             export DYLD_INSERT_LIBRARIES=$CASSANDRA_LIBJEMALLOC
-         else
-             echo "WARNING could not find libjemalloc.dylib, please install for better performance - search path: $DYLD_LIBRARY_PATH:${DYLD_FALLBACK_LIBRARY_PATH-$HOME/lib:/usr/local/lib:/lib:/usr/lib}"
-         fi
-     ;;
- esac
- 
 +# Here we create the arguments that will get passed to the jvm when
 +# starting cassandra.
  
 -# Specifies the default port over which Cassandra will be available for
 -# JMX connections.
 -# For security reasons, you should not expose this port to the internet.  Firewall it if needed.
 -JMX_PORT="7199"
 +# Read user-defined JVM options from jvm.options file
 +JVM_OPTS_FILE=$CASSANDRA_CONF/jvm.options
 +for opt in `grep "^-" $JVM_OPTS_FILE`
 +do
 +  JVM_OPTS="$JVM_OPTS $opt"
 +done
 +
 +# Check what parameters were defined on jvm.options file to avoid conflicts
 +echo $JVM_OPTS | grep -q Xmn
 +DEFINED_XMN=$?
 +echo $JVM_OPTS | grep -q Xmx
 +DEFINED_XMX=$?
 +echo $JVM_OPTS | grep -q Xms
 +DEFINED_XMS=$?
 +echo $JVM_OPTS | grep -q UseConcMarkSweepGC
 +USING_CMS=$?
 +
 +# We only set -Xms and -Xmx if they were not defined on jvm.options file
 +# If defined, both Xmx and Xms should be defined together.
 +if [ $DEFINED_XMX -ne 0 ] && [ $DEFINED_XMS -ne 0 ]; then
 +     JVM_OPTS="$JVM_OPTS -Xms${MAX_HEAP_SIZE}"
 +     JVM_OPTS="$JVM_OPTS -Xmx${MAX_HEAP_SIZE}"
 +elif [ $DEFINED_XMX -ne 0 ] || [ $DEFINED_XMS -ne 0 ]; then
 +     echo "Please set or unset -Xmx and -Xms flags in pairs on jvm.options file."
 +     exit 1
 +fi
  
 +# We only set -Xmn flag if it was not defined in jvm.options file
 +# and if the CMS GC is being used
 +# If defined, both Xmn and Xmx should be defined together.
 +if [ $DEFINED_XMN -eq 0 ] && [ $DEFINED_XMX -ne 0 ]; then
 +    echo "Please set or unset -Xmx and -Xmn flags in pairs on jvm.options file."
 +    exit 1
 +elif [ $DEFINED_XMN -ne 0 ] && [ $USING_CMS -eq 0 ]; then
 +    JVM_OPTS="$JVM_OPTS -Xmn${HEAP_NEWSIZE}"
 +fi
  
 -# Here we create the arguments that will get passed to the jvm when
 -# starting cassandra.
 +if [ "$JVM_ARCH" = "64-Bit" ] && [ $USING_CMS -eq 0 ]; then
 +    JVM_OPTS="$JVM_OPTS -XX:+UseCondCardMark"
 +fi
  
  # enable assertions.  disabling this in production will give a modest
  # performance benefit (around 5%).

http://git-wip-us.apache.org/repos/asf/cassandra/blob/242b9738/src/java/org/apache/cassandra/service/StartupChecks.java
----------------------------------------------------------------------