You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by sl...@apache.org on 2016/01/08 10:33:10 UTC

[2/3] cassandra git commit: Enable GC logging by default (3.0 version)

Enable GC logging by default (3.0 version)

patch by Chris Lohfink; reviewed by aweisberg for CASSANDRA-10140


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

Branch: refs/heads/trunk
Commit: 87d80b478bd47770460ecf7a8713e00d2f53fcca
Parents: 1717e10
Author: Ariel Weisberg <ar...@datastax.com>
Authored: Tue Dec 29 14:33:26 2015 -0500
Committer: Sylvain Lebresne <sy...@datastax.com>
Committed: Fri Jan 8 10:32:22 2016 +0100

----------------------------------------------------------------------
 NEWS.txt                                      |  2 ++
 conf/cassandra-env.ps1                        |  3 +++
 conf/cassandra-env.sh                         |  3 +++
 conf/jvm.options                              | 18 +++++++++---------
 debian/patches/002cassandra_logdir_fix.dpatch | 18 +++++++++++++++---
 5 files changed, 32 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/87d80b47/NEWS.txt
----------------------------------------------------------------------
diff --git a/NEWS.txt b/NEWS.txt
index dcdd309..b6b9e92 100644
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -56,6 +56,8 @@ Upgrading
    - Custom index implementation should be aware that the method Indexer::indexes()
      has been removed as its contract was misleading and all custom implementation
      should have almost surely returned true inconditionally for that method.
+   - GC logging is now enabled by default (you can disable it in the jvm.options
+     file if you prefer).
 
 
 3.0

http://git-wip-us.apache.org/repos/asf/cassandra/blob/87d80b47/conf/cassandra-env.ps1
----------------------------------------------------------------------
diff --git a/conf/cassandra-env.ps1 b/conf/cassandra-env.ps1
index 0326199..2a9acce 100644
--- a/conf/cassandra-env.ps1
+++ b/conf/cassandra-env.ps1
@@ -333,6 +333,9 @@ Function SetCassandraEnvironment
 
     ParseJVMInfo
 
+    #GC log path has to be defined here since it needs to find CASSANDRA_HOME
+    $env:JVM_OPTS="$env:JVM_OPTS -Xloggc:$env:CASSANDRA_HOME/logs/gc.log"
+
     # Read user-defined JVM options from jvm.options file
     $content = Get-Content "$env:CASSANDRA_CONF\jvm.options"
     for ($i = 0; $i -lt $content.Count; $i++)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/87d80b47/conf/cassandra-env.sh
----------------------------------------------------------------------
diff --git a/conf/cassandra-env.sh b/conf/cassandra-env.sh
index 477a4f3..6e1910c 100644
--- a/conf/cassandra-env.sh
+++ b/conf/cassandra-env.sh
@@ -156,6 +156,9 @@ if [ "x$MALLOC_ARENA_MAX" = "x" ] ; then
     export MALLOC_ARENA_MAX=4
 fi
 
+#GC log path has to be defined here because it needs to access CASSANDRA_HOME
+JVM_OPTS="$JVM_OPTS -Xloggc:${CASSANDRA_HOME}/logs/gc.log"
+
 # Here we create the arguments that will get passed to the jvm when
 # starting cassandra.
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/87d80b47/conf/jvm.options
----------------------------------------------------------------------
diff --git a/conf/jvm.options b/conf/jvm.options
index ad0edb0..4aec619 100644
--- a/conf/jvm.options
+++ b/conf/jvm.options
@@ -222,14 +222,14 @@
 
 ### GC logging options -- uncomment to enable
 
-#-XX:+PrintGCDetails
-#-XX:+PrintGCDateStamps
-#-XX:+PrintHeapAtGC
-#-XX:+PrintTenuringDistribution
-#-XX:+PrintGCApplicationStoppedTime
-#-XX:+PrintPromotionFailure
+-XX:+PrintGCDetails
+-XX:+PrintGCDateStamps
+-XX:+PrintHeapAtGC
+-XX:+PrintTenuringDistribution
+-XX:+PrintGCApplicationStoppedTime
+-XX:+PrintPromotionFailure
 #-XX:PrintFLSStatistics=1
 #-Xloggc:/var/log/cassandra/gc.log
-#-XX:+UseGCLogFileRotation
-#-XX:NumberOfGCLogFiles=10
-#-XX:GCLogFileSize=10M
+-XX:+UseGCLogFileRotation
+-XX:NumberOfGCLogFiles=10
+-XX:GCLogFileSize=10M

http://git-wip-us.apache.org/repos/asf/cassandra/blob/87d80b47/debian/patches/002cassandra_logdir_fix.dpatch
----------------------------------------------------------------------
diff --git a/debian/patches/002cassandra_logdir_fix.dpatch b/debian/patches/002cassandra_logdir_fix.dpatch
index 8836eb4..87387b9 100644
--- a/debian/patches/002cassandra_logdir_fix.dpatch
+++ b/debian/patches/002cassandra_logdir_fix.dpatch
@@ -6,9 +6,9 @@
 
 @DPATCH@
 diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' cassandra~/bin/cassandra cassandra/bin/cassandra
---- cassandra~/bin/cassandra	2014-09-15 19:42:28.000000000 -0500
-+++ cassandra/bin/cassandra	2014-09-15 21:15:15.627505503 -0500
-@@ -134,7 +134,7 @@
+--- cassandra~/bin/cassandra	2015-10-27 14:35:22.000000000 -0500
++++ cassandra/bin/cassandra	2015-10-27 14:41:38.000000000 -0500
+@@ -139,7 +139,7 @@
      props="$3"
      class="$4"
      cassandra_parms="-Dlogback.configurationFile=logback.xml"
@@ -17,3 +17,15 @@ diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch'
      cassandra_parms="$cassandra_parms -Dcassandra.storagedir=$cassandra_storagedir"
  
      if [ "x$pidpath" != "x" ]; then
+diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' cassandra~/conf/cassandra-env.sh cassandra/conf/cassandra-env.sh
+--- cassandra~/conf/cassandra-env.sh	2015-10-27 14:40:39.000000000 -0500
++++ cassandra/conf/cassandra-env.sh	2015-10-27 14:42:40.647449856 -0500
+@@ -204,7 +204,7 @@
+ esac
+ 
+ #GC log path has to be defined here because it needs to access CASSANDRA_HOME
+-JVM_OPTS="$JVM_OPTS -Xloggc:${CASSANDRA_HOME}/logs/gc.log"
++JVM_OPTS="$JVM_OPTS -Xloggc:/var/log/cassandra/gc.log"
+ 
+ # Here we create the arguments that will get passed to the jvm when
+ # starting cassandra.