Apache Solr open-source search software
SOLR-15410: Always use -Xverbosegclog for OpenJ9 (#131)
Colvin Cowieb113d36017b3
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex 3474bf65629..9ff4c91a62b 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -322,6 +322,8 @@ Bug Fixes* SOLR-15449: Edismax sow incorrectly affect mm parameter in multi field search (Alessandro Benedetti, Michael Gibney, David Smiley)+* SOLR-15410: Always use -Xverbosegclog for OpenJ9. (Colvin Cowie via Eric Pugh)+================== 8.10.0 ==================Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.diff --git a/solr/bin/solr b/solr/bin/solrindex be107b48dbb..86d911d7aa5 100755--- a/solr/bin/solr+++ b/solr/bin/solr@@ -166,8 +166,9 @@ elseexit 1fiJAVA_VENDOR="Oracle"- if [ "`echo $JAVA_VER | grep -i "IBM J9"`" != "" ]; then- JAVA_VENDOR="IBM J9"+ # OpenJ9 was previously known as IBM J9, this will match both+ if [ "`echo $JAVA_VER | grep -i -E "OpenJ9|IBM J9"`" != "" ]; then+ JAVA_VENDOR="OpenJ9"fifi@@ -2023,9 +2024,9 @@ fi# if verbose gc logging enabled, setup the location of the log file and rotationif [ "$GC_LOG_OPTS" != "" ]; then- if [[ "$JAVA_VER_NUM" -lt "9" ]] ; then+ if [[ "$JAVA_VER_NUM" -lt "9" ]] || [ "$JAVA_VENDOR" == "OpenJ9" ]; thengc_log_flag="-Xloggc"- if [ "$JAVA_VENDOR" == "IBM J9" ]; then+ if [ "$JAVA_VENDOR" == "OpenJ9" ]; thengc_log_flag="-Xverbosegclog"fiif [ -z ${JAVA8_GC_LOG_FILE_OPTS+x} ]; thendiff --git a/solr/bin/solr.cmd b/solr/bin/solr.cmdindex f06b50f2716..5dd67db38b0 100755--- a/solr/bin/solr.cmd+++ b/solr/bin/solr.cmd@@ -1224,7 +1224,7 @@ IF "%GC_TUNE%"=="" (-XX:+ExplicitGCInvokesConcurrent)-if !JAVA_MAJOR_VERSION! GEQ 9 (+if !JAVA_MAJOR_VERSION! GEQ 9 if NOT "%JAVA_VENDOR%" == "OpenJ9" (IF NOT "%GC_LOG_OPTS%"=="" (echo ERROR: On Java 9 you cannot set GC_LOG_OPTS, only default GC logging is available. ExitingGOTO :eof@@ -1241,7 +1241,7 @@ if !JAVA_MAJOR_VERSION! GEQ 9 (-XX:+PrintTenuringDistribution ^-XX:+PrintGCApplicationStoppedTime)- if "%JAVA_VENDOR%" == "IBM J9" (+ if "%JAVA_VENDOR%" == "OpenJ9" (set GC_LOG_OPTS=!GC_LOG_OPTS! "-Xverbosegclog:!SOLR_LOGS_DIR!\solr_gc.log" -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=9 -XX:GCLogFileSize=20M) else (set GC_LOG_OPTS=!GC_LOG_OPTS! "-Xloggc:!SOLR_LOGS_DIR!\solr_gc.log" -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=9 -XX:GCLogFileSize=20M@@ -2049,7 +2049,6 @@ CALL :resolve_java_vendorset JAVA_MAJOR_VERSION=0set JAVA_VERSION_INFO=-set JAVA_BUILD=0FOR /f "usebackq tokens=3" %%a IN (`^""%JAVA%" -version 2^>^&1 ^| findstr "version"^"`) do (set JAVA_VERSION_INFO=%%a@@ -2066,20 +2065,14 @@ FOR /f "usebackq tokens=3" %%a IN (`^""%JAVA%" -version 2^>^&1 ^| findstr "versiset JAVA_MAJOR_VERSION=%%b))-- REM Don't look for "_{build}" if we're on IBM J9.- if NOT "%JAVA_VENDOR%" == "IBM J9" (- for /f "delims=_ tokens=2" %%a in ("!JAVA_VERSION_INFO!") do (- set /a JAVA_BUILD=%%a- )- ))GOTO :eofREM Set which JVM vendor we have:resolve_java_vendor-"%JAVA%" -version 2>&1 | findstr /i "IBM J9" > nul-if %ERRORLEVEL% == 1 ( set "JAVA_VENDOR=Oracle" ) else ( set "JAVA_VENDOR=IBM J9" )+REM OpenJ9 was previously known as IBM J9, this will match both+"%JAVA%" -version 2>&1 | findstr /i /C:"IBM J9" /C:"OpenJ9" > nul+if %ERRORLEVEL% == 1 ( set "JAVA_VENDOR=Oracle" ) else ( set "JAVA_VENDOR=OpenJ9" )set JAVA_VENDOR_OUT=GOTO :eofdiff --git a/solr/bin/solr.in.cmd b/solr/bin/solr.in.cmdindex 5a0f18a40a2..5ce8b339152 100755--- a/solr/bin/solr.in.cmd+++ b/solr/bin/solr.in.cmd@@ -30,7 +30,7 @@ REM set SOLR_JAVA_MEM=-Xms512m -Xmx512mREM Configure verbose GC logging:REM For Java 8: if this is set, additional params will be added to specify the log file & rotation-REM For Java 9 or higher: GC_LOG_OPTS is currently not supported. If you set it, the startup script will exit with failure.+REM For Java 9 or higher: GC_LOG_OPTS is currently not supported unless you are using OpenJ9. Otherwise if you set it, the startup script will exit with failure.REM set GC_LOG_OPTS=-verbose:gc -XX:+PrintHeapAtGC -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTimeREM Various GC settings have shown to work well for a number of common Solr workloads.