Skip to content

Migrate to dot seperate naming of environment variables #3312

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dev-tools/scripts/cloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ start(){
mkdir -p "${CLUSTER_WD}/n${i}"
argsArray=(-c --solr-home $CLUSTER_WD_FULL/n${i} -z localhost:${ZK_PORT}/solr_${SAFE_DEST} -p 898${i} -m $MEMORY \
-a "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=500${i} \
-Dsolr.log.dir=$CLUSTER_WD_FULL/n${i} $JVM_ARGS")
-Dsolr.logs.dir=$CLUSTER_WD_FULL/n${i} $JVM_ARGS")
FINAL_COMMAND="${SOLR}/bin/solr ${argsArray[@]}"
echo ${FINAL_COMMAND}
${SOLR}/bin/solr start "${argsArray[@]}"
Expand Down
2 changes: 1 addition & 1 deletion gradle/ide/eclipse/run-solr-cloud.launch
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.jetty.start.Main"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="--module=http"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="@ECLIPSEPROJECTNAME@"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms512m &#13;&#10;-Djetty.port=8983&#13;&#10;-DSTOP.PORT=7983 &#13;&#10;-DSTOP.KEY=solrrock&#13;&#10;-Dlog4j.configurationFile=&quot;file:${workspace_loc:@ECLIPSEPROJECTNAME@}/solr/server/resources/log4j2.xml&quot;&#13;&#10;-Djetty.home=&quot;${workspace_loc:@ECLIPSEPROJECTNAME@}/eclipse-build/solr-server&quot;&#13;&#10;-Djetty.base=&quot;${workspace_loc:@ECLIPSEPROJECTNAME@}/eclipse-build/solr-server&quot;&#13;&#10;-Dsolr.log=&quot;${workspace_loc:@ECLIPSEPROJECTNAME@}/eclipse-build&quot;&#13;&#10;-Dsolr.log.dir=&quot;${workspace_loc:@ECLIPSEPROJECTNAME@}/eclipse-build&quot;&#13;&#10;-Dsolr.solr.home=&quot;${workspace_loc:@ECLIPSEPROJECTNAME@}/eclipse-build/solr-server/solr&quot;&#13;&#10;-DzkRun"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms512m &#13;&#10;-Djetty.port=8983&#13;&#10;-DSTOP.PORT=7983 &#13;&#10;-DSTOP.KEY=solrrock&#13;&#10;-Dlog4j.configurationFile=&quot;file:${workspace_loc:@ECLIPSEPROJECTNAME@}/solr/server/resources/log4j2.xml&quot;&#13;&#10;-Djetty.home=&quot;${workspace_loc:@ECLIPSEPROJECTNAME@}/eclipse-build/solr-server&quot;&#13;&#10;-Djetty.base=&quot;${workspace_loc:@ECLIPSEPROJECTNAME@}/eclipse-build/solr-server&quot;&#13;&#10;-Dsolr.log=&quot;${workspace_loc:@ECLIPSEPROJECTNAME@}/eclipse-build&quot;&#13;&#10;-Dsolr.logs.dir=&quot;${workspace_loc:@ECLIPSEPROJECTNAME@}/eclipse-build&quot;&#13;&#10;-Dsolr.solr.home=&quot;${workspace_loc:@ECLIPSEPROJECTNAME@}/eclipse-build/solr-server/solr&quot;&#13;&#10;-DzkRun"/>
</launchConfiguration>
2 changes: 1 addition & 1 deletion gradle/ide/eclipse/run-solr.launch
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.jetty.start.Main"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="--module=http"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="@ECLIPSEPROJECTNAME@"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms512m &#13;&#10;-Djetty.port=8983&#13;&#10;-DSTOP.PORT=7983 &#13;&#10;-DSTOP.KEY=solrrock&#13;&#10;-Dlog4j.configurationFile=&quot;file:${workspace_loc:@ECLIPSEPROJECTNAME@}/solr/server/resources/log4j2.xml&quot;&#13;&#10;-Djetty.home=&quot;${workspace_loc:@ECLIPSEPROJECTNAME@}/eclipse-build/solr-server&quot;&#13;&#10;-Djetty.base=&quot;${workspace_loc:@ECLIPSEPROJECTNAME@}/eclipse-build/solr-server&quot;&#13;&#10;-Dsolr.log=&quot;${workspace_loc:@ECLIPSEPROJECTNAME@}/eclipse-build&quot;&#13;&#10;-Dsolr.log.dir=&quot;${workspace_loc:@ECLIPSEPROJECTNAME@}/eclipse-build&quot;&#13;&#10;-Dsolr.solr.home=&quot;${workspace_loc:@ECLIPSEPROJECTNAME@}/eclipse-build/solr-server/solr&quot;"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms512m &#13;&#10;-Djetty.port=8983&#13;&#10;-DSTOP.PORT=7983 &#13;&#10;-DSTOP.KEY=solrrock&#13;&#10;-Dlog4j.configurationFile=&quot;file:${workspace_loc:@ECLIPSEPROJECTNAME@}/solr/server/resources/log4j2.xml&quot;&#13;&#10;-Djetty.home=&quot;${workspace_loc:@ECLIPSEPROJECTNAME@}/eclipse-build/solr-server&quot;&#13;&#10;-Djetty.base=&quot;${workspace_loc:@ECLIPSEPROJECTNAME@}/eclipse-build/solr-server&quot;&#13;&#10;-Dsolr.log=&quot;${workspace_loc:@ECLIPSEPROJECTNAME@}/eclipse-build&quot;&#13;&#10;-Dsolr.logs.dir=&quot;${workspace_loc:@ECLIPSEPROJECTNAME@}/eclipse-build&quot;&#13;&#10;-Dsolr.solr.home=&quot;${workspace_loc:@ECLIPSEPROJECTNAME@}/eclipse-build/solr-server/solr&quot;"/>
</launchConfiguration>
4 changes: 2 additions & 2 deletions gradle/testing/randomization/policies/solr-tests.policy
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,8 @@ grant {
permission java.io.FilePermission "${solr.default.confdir}", "read,write,delete,readlink";
permission java.io.FilePermission "${solr.default.confdir}${/}-", "read,write,delete,readlink";

permission java.io.FilePermission "${solr.log.dir}", "read,write,delete,readlink";
permission java.io.FilePermission "${solr.log.dir}${/}-", "read,write,delete,readlink";
permission java.io.FilePermission "${solr.logs.dir}", "read,write,delete,readlink";
permission java.io.FilePermission "${solr.logs.dir}${/}-", "read,write,delete,readlink";

permission java.io.FilePermission "${solr.allowPaths}", "read,write,delete,readlink";
permission java.io.FilePermission "${solr.allowPaths}${/}-", "read,write,delete,readlink";
Expand Down
12 changes: 6 additions & 6 deletions solr/benchmark/log4j2-bench.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@

<RollingRandomAccessFile
name="MainLogFile"
fileName="${sys:solr.log.dir:-build/work/solr-logs}/${sys:solr.log.name:-solr}.log"
filePattern="${sys:solr.log.dir:-build/work/solr-logs}/${sys:solr.log.name:-solr}.log.%i">
fileName="${sys:solr.logs.dir:-build/work/solr-logs}/${sys:solr.log.name:-solr}.log"
filePattern="${sys:solr.logs.dir:-build/work/solr-logs}/${sys:solr.log.name:-solr}.log.%i">
<PatternLayout>
<Pattern>
%maxLen{%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p (%t) [%notEmpty{c:%X{collection}}%notEmpty{ s:%X{shard}}%notEmpty{ r:%X{replica}}%notEmpty{ x:%X{core}}] %c{1.}
Expand All @@ -48,8 +48,8 @@

<RollingRandomAccessFile
name="SlowLogFile"
fileName="${sys:solr.log.dir:-build/work/solr-logs}/${sys:solr.log.name:-solr}_slow_requests.log"
filePattern="${sys:solr.log.dir:-build/work/solr-logs}/${sys:solr.log.name:-solr}_slow_requests.log.%i">
fileName="${sys:solr.logs.dir:-build/work/solr-logs}/${sys:solr.log.name:-solr}_slow_requests.log"
filePattern="${sys:solr.logs.dir:-build/work/solr-logs}/${sys:solr.log.name:-solr}_slow_requests.log.%i">
<PatternLayout>
<Pattern>
%maxLen{%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p (%t) [%notEmpty{c:%X{collection}}%notEmpty{ s:%X{shard}}%notEmpty{ r:%X{replica}}%notEmpty{ x:%X{core}}] %c{1.}
Expand All @@ -66,8 +66,8 @@

<RollingRandomAccessFile
name="RandomCountsFile"
fileName="${sys:solr.log.dir:-build/work/solr-logs}/${sys:solr.log.name:-solr}_random_counts.log"
filePattern="${sys:solr.log.dir:-build/work/solr-logs}/${sys:solr.log.name:-solr}_random_counts.log.%i">
fileName="${sys:solr.logs.dir:-build/work/solr-logs}/${sys:solr.log.name:-solr}_random_counts.log"
filePattern="${sys:solr.logs.dir:-build/work/solr-logs}/${sys:solr.log.name:-solr}_random_counts.log.%i">
<PatternLayout>
<Pattern>
%maxLen{%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p (%t) [%notEmpty{c:%X{collection}}%notEmpty{ s:%X{shard}}%notEmpty{ r:%X{replica}}%notEmpty{ x:%X{core}}] %c{1.}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public void doSetup(BenchmarkParams benchmarkParams) {

workDir = System.getProperty("workBaseDir", "build/work");

System.setProperty("solr.log.dir", workDir + "/logs");
System.setProperty("solr.logs.dir", workDir + "/logs");
System.setProperty("solr.log.name", benchmarkParams.id());
}

Expand Down
10 changes: 5 additions & 5 deletions solr/benchmark/src/test-files/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@

<RollingRandomAccessFile
name="MainLogFile"
fileName="${sys:solr.log.dir:-build/work/solr-logs}/${sys:solr.log.name:-solr}.log"
filePattern="${sys:solr.log.dir:-build/work/solr-logs}/${sys:solr.log.name:-solr}.log.%i">
fileName="${sys:solr.logs.dir:-build/work/solr-logs}/${sys:solr.log.name:-solr}.log"
filePattern="${sys:solr.logs.dir:-build/work/solr-logs}/${sys:solr.log.name:-solr}.log.%i">
<PatternLayout>
<Pattern>
%maxLen{%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p (%t) [%notEmpty{c:%X{collection}}%notEmpty{ s:%X{shard}}%notEmpty{ r:%X{replica}}%notEmpty{ x:%X{core}}] %c{1.}
Expand All @@ -48,8 +48,8 @@

<RollingRandomAccessFile
name="SlowLogFile"
fileName="${sys:solr.log.dir:-build/work/solr-logs}/${sys:solr.log.name:-solr}_slow_requests.log"
filePattern="${sys:solr.log.dir:-build/work/solr-logs}/${sys:solr.log.name:-solr}_slow_requests.log.%i">
fileName="${sys:solr.logs.dir:-build/work/solr-logs}/${sys:solr.log.name:-solr}_slow_requests.log"
filePattern="${sys:solr.logs.dir:-build/work/solr-logs}/${sys:solr.log.name:-solr}_slow_requests.log.%i">
<PatternLayout>
<Pattern>
%maxLen{%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p (%t) [%notEmpty{c:%X{collection}}%notEmpty{ s:%X{shard}}%notEmpty{ r:%X{replica}}%notEmpty{ x:%X{core}}] %c{1.}
Expand All @@ -65,7 +65,7 @@

<RandomAccessFile
name="RandomCountsFile"
fileName="${sys:solr.log.dir:-build/work/solr-logs}/${sys:solr.log.name:-solr}_random_counts.log">
fileName="${sys:solr.logs.dir:-build/work/solr-logs}/${sys:solr.log.name:-solr}_random_counts.log">
<PatternLayout>
<Pattern>
%maxLen{%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p (%t) [%notEmpty{c:%X{collection}}%notEmpty{ s:%X{shard}}%notEmpty{ r:%X{replica}}%notEmpty{ x:%X{core}}] %c{1.}
Expand Down
34 changes: 6 additions & 28 deletions solr/bin/solr
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ if [ $$ -ne $(ps -o pid='' -p $$ || echo 0) ] ; then
exit 1
fi

# This helps with debugging when running bats tests but not the whole script is compliant yet
# This helps with debugging when running bats tests however the whole script is not compliant yet
# set -u
# set -o pipefail

Expand Down Expand Up @@ -114,7 +114,7 @@ fi

# Export variables we want to make visible to Solr sub-process
for var in $(compgen -v); do
if [[ "$var" =~ ^(SOLR_.*|DEFAULT_CONFDIR|ZK_.*|GCS_BUCKET|GCS_.*|S3_.*|OTEL_.*|AWS_.*)$ ]]; then
if [[ "$var" =~ ^(SOLR_.*|ZK_.*|GCS_BUCKET|GCS_.*|S3_.*|OTEL_.*|AWS_.*)$ ]]; then
export "${var?}"
fi
done
Expand Down Expand Up @@ -856,14 +856,6 @@ if [[ -n "${SOLR_PLACEMENTPLUGIN_DEFAULT:-}" ]] ; then
SCRIPT_SOLR_OPTS+=("-Dsolr.placementplugin.default=$SOLR_PLACEMENTPLUGIN_DEFAULT")
fi

# Remote streaming and stream body
if [ "${SOLR_ENABLE_REMOTE_STREAMING:-false}" == "true" ]; then
SCRIPT_SOLR_OPTS+=("-Dsolr.enableRemoteStreaming=true")
fi
if [ "${SOLR_ENABLE_STREAM_BODY:-false}" == "true" ]; then
SCRIPT_SOLR_OPTS+=("-Dsolr.enableStreamBody=true")
fi

: ${SOLR_SERVER_DIR:=$DEFAULT_SERVER_DIR}

if [ ! -e "$SOLR_SERVER_DIR" ]; then
Expand Down Expand Up @@ -1018,7 +1010,8 @@ elif [[ $SOLR_HOME != /* ]]; then
fi

# Set the default configset dir to be bootstrapped as _default
: "${DEFAULT_CONFDIR:="$SOLR_SERVER_DIR/solr/configsets/_default/conf"}"
: "${SOLR_DEFAULT_CONFDIR:="$SOLR_SERVER_DIR/solr/configsets/_default/conf"}"
export SOLR_DEFAULT_CONFDIR

# This is quite hacky, but examples rely on a different log4j2.xml
# so that we can write logs for examples to $SOLR_HOME/../logs
Expand Down Expand Up @@ -1156,14 +1149,6 @@ else
SECURITY_MANAGER_OPTS=()
fi

# Enable Admin UI by default, and give the option for users to disable it
if [ "${SOLR_ADMIN_UI_DISABLED:-false}" == "true" ]; then
SOLR_ADMIN_UI="-DdisableAdminUI=true"
echo -e "ADMIN UI Disabled"
else
SOLR_ADMIN_UI="-DdisableAdminUI=false"
fi

JAVA_MEM_OPTS=()
if [ -z "${SOLR_HEAP:-}" ] && [ -n "${SOLR_JAVA_MEM:-}" ]; then
JAVA_MEM_OPTS=($SOLR_JAVA_MEM)
Expand Down Expand Up @@ -1213,17 +1198,10 @@ function start_solr() {
GC_TUNE_ARR=($GC_TUNE) # Stuff the string from outside into first value of the array
fi

if [ -n "${SOLR_WAIT_FOR_ZK:-}" ]; then
SCRIPT_SOLR_OPTS+=("-DwaitForZk=$SOLR_WAIT_FOR_ZK")
fi

if [ -n "${SOLR_DATA_HOME:-}" ]; then
SCRIPT_SOLR_OPTS+=("-Dsolr.data.home=$SOLR_DATA_HOME")
fi

if [ -n "${SOLR_DELETE_UNKNOWN_CORES:-}" ]; then
SCRIPT_SOLR_OPTS+=("-Dsolr.deleteUnknownCores=$SOLR_DELETE_UNKNOWN_CORES")
fi

# If SSL-related system props are set, add them to SCRIPT_SOLR_OPTS
if [ "$SOLR_SSL_ENABLED" == "true" ]; then
Expand Down Expand Up @@ -1307,7 +1285,7 @@ function start_solr() {
SCRIPT_SOLR_OPTS+=("--add-modules" "jdk.incubator.vector")

SOLR_START_OPTS=('-server' "${JAVA_MEM_OPTS[@]}" "${GC_TUNE_ARR[@]}" "${GC_LOG_OPTS[@]}" "${IP_ACL_OPTS[@]}" \
"${REMOTE_JMX_OPTS[@]}" "${CLOUD_MODE_OPTS[@]}" -Dsolr.log.dir="$SOLR_LOGS_DIR" \
"${REMOTE_JMX_OPTS[@]}" "${CLOUD_MODE_OPTS[@]}" -Dsolr.logs.dir="$SOLR_LOGS_DIR" \
"-Djetty.port=$SOLR_PORT" "-DSTOP.PORT=$stop_port" "-DSTOP.KEY=$STOP_KEY" \
# '-OmitStackTraceInFastThrow' ensures stack traces in errors,
# users who don't care about useful error msgs can override in SOLR_OPTS with +OmitStackTraceInFastThrow
Expand All @@ -1316,7 +1294,7 @@ function start_solr() {
# OOME is thrown. Program operation after OOME is unpredictable.
"-XX:+CrashOnOutOfMemoryError" "-XX:ErrorFile=${SOLR_LOGS_DIR}/jvm_crash_%p.log" \
"-Djetty.home=$SOLR_SERVER_DIR" "-Dsolr.solr.home=$SOLR_HOME" "-Dsolr.install.dir=$SOLR_TIP" "-Dsolr.install.symDir=$SOLR_TIP_SYM" \
"-Dsolr.default.confdir=$DEFAULT_CONFDIR" "${LOG4J_CONFIG[@]}" "${SCRIPT_SOLR_OPTS[@]}" "${SECURITY_MANAGER_OPTS[@]}" "${SOLR_ADMIN_UI}" "${SOLR_OPTS[@]}")
"${LOG4J_CONFIG[@]}" "${SCRIPT_SOLR_OPTS[@]}" "${SECURITY_MANAGER_OPTS[@]}" "${SOLR_OPTS[@]}")

mk_writable_dir "$SOLR_LOGS_DIR" "Logs"
if [[ -n "${SOLR_HEAP_DUMP_DIR:-}" ]]; then
Expand Down
34 changes: 5 additions & 29 deletions solr/bin/solr.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -728,14 +728,6 @@ IF DEFINED SOLR_PLACEMENTPLUGIN_DEFAULT (
set "SCRIPT_SOLR_OPTS=%SCRIPT_SOLR_OPTS% -Dsolr.placementplugin.default=%SOLR_PLACEMENTPLUGIN_DEFAULT%"
)

REM Remote streaming and stream body
IF "%SOLR_ENABLE_REMOTE_STREAMING%"=="true" (
set "SCRIPT_SOLR_OPTS=%SCRIPT_SOLR_OPTS% -Dsolr.enableRemoteStreaming=true"
)
IF "%SOLR_ENABLE_STREAM_BODY%"=="true" (
set "SCRIPT_SOLR_OPTS=%SCRIPT_SOLR_OPTS% -Dsolr.enableStreamBody=true"
)

IF "%SOLR_SERVER_DIR%"=="" set "SOLR_SERVER_DIR=%DEFAULT_SERVER_DIR%"

IF NOT EXIST "%SOLR_SERVER_DIR%" (
Expand Down Expand Up @@ -925,14 +917,6 @@ IF "%SOLR_MODE%"=="solrcloud" (

set "CLOUD_MODE_OPTS=-DzkClientTimeout=!ZK_CLIENT_TIMEOUT!"

IF NOT "%SOLR_WAIT_FOR_ZK%"=="" (
set "CLOUD_MODE_OPTS=!CLOUD_MODE_OPTS! -DwaitForZk=%SOLR_WAIT_FOR_ZK%"
)

IF NOT "%SOLR_DELETE_UNKNOWN_CORES%"=="" (
set "CLOUD_MODE_OPTS=!CLOUD_MODE_OPTS! -Dsolr.deleteUnknownCores=%SOLR_DELETE_UNKNOWN_CORES%"
)

IF NOT "%ZK_HOST%"=="" (
set "CLOUD_MODE_OPTS=!CLOUD_MODE_OPTS! -DzkHost=%ZK_HOST%"
) ELSE (
Expand Down Expand Up @@ -1006,13 +990,6 @@ IF "%SOLR_SECURITY_MANAGER_ENABLED%"=="true" (
-Dsolr.internal.network.permission=*
)

REM Enable ADMIN UI by default, and give the option for users to disable it
IF "%SOLR_ADMIN_UI_DISABLED%"=="true" (
set DISABLE_ADMIN_UI="true"
) else (
set DISABLE_ADMIN_UI="false"
)

IF NOT "%SOLR_HEAP%"=="" set SOLR_JAVA_MEM=-Xms%SOLR_HEAP% -Xmx%SOLR_HEAP%
IF "%SOLR_JAVA_MEM%"=="" set SOLR_JAVA_MEM=-Xms512m -Xmx512m
IF "%SOLR_JAVA_STACK_SIZE%"=="" set SOLR_JAVA_STACK_SIZE=-Xss256k
Expand Down Expand Up @@ -1094,7 +1071,6 @@ REM OOME is thrown. Program operation after OOME is unpredictable.
set START_OPTS=%START_OPTS% -XX:+CrashOnOutOfMemoryError
set START_OPTS=%START_OPTS% -XX:ErrorFile="%SOLR_LOGS_DIR%\jvm_crash_%%p.log"
set START_OPTS=%START_OPTS% !GC_TUNE! %GC_LOG_OPTS%
set START_OPTS=%START_OPTS% -DdisableAdminUI=%DISABLE_ADMIN_UI%
IF NOT "!CLOUD_MODE_OPTS!"=="" set "START_OPTS=%START_OPTS% !CLOUD_MODE_OPTS!"
IF NOT "!IP_ACL_OPTS!"=="" set "START_OPTS=%START_OPTS% !IP_ACL_OPTS!"
IF NOT "!REMOTE_JMX_OPTS!"=="" set "START_OPTS=%START_OPTS% !REMOTE_JMX_OPTS!"
Expand All @@ -1111,7 +1087,7 @@ IF "%SOLR_SSL_ENABLED%"=="true" (
set SOLR_LOGS_DIR_QUOTED="%SOLR_LOGS_DIR%"
set SOLR_DATA_HOME_QUOTED="%SOLR_DATA_HOME%"

set "START_OPTS=%START_OPTS% -Dsolr.log.dir=%SOLR_LOGS_DIR_QUOTED%"
set "START_OPTS=%START_OPTS% -Dsolr.logs.dir=%SOLR_LOGS_DIR_QUOTED%"
IF NOT "%SOLR_DATA_HOME%"=="" set "START_OPTS=%START_OPTS% -Dsolr.data.home=%SOLR_DATA_HOME_QUOTED%"
IF NOT DEFINED LOG4J_CONFIG set "LOG4J_CONFIG=%SOLR_SERVER_DIR%\resources\log4j2.xml"

Expand Down Expand Up @@ -1141,23 +1117,23 @@ IF NOT EXIST "%SOLR_SERVER_DIR%\tmp" (
mkdir "%SOLR_SERVER_DIR%\tmp"
)

IF "%DEFAULT_CONFDIR%"=="" set "DEFAULT_CONFDIR=%SOLR_SERVER_DIR%\solr\configsets\_default\conf"
IF "%SOLR_DEFAULT_CONFDIR%"=="" set "SOLR_DEFAULT_CONFDIR=%SOLR_SERVER_DIR%\solr\configsets\_default\conf"

IF "%FG%"=="1" (
REM run solr in the foreground
title "Solr-%SOLR_PORT%"
echo %SOLR_PORT%>"%SOLR_TIP%"\bin\solr-%SOLR_PORT%.port
"%JAVA%" %SERVEROPT% %SOLR_JAVA_MEM% %START_OPTS% ^
-Dlog4j.configurationFile="%LOG4J_CONFIG%" -DSTOP.PORT=!STOP_PORT! -DSTOP.KEY=%STOP_KEY% ^
-Dsolr.solr.home="%SOLR_HOME%" -Dsolr.install.dir="%SOLR_TIP%" -Dsolr.install.symDir="%SOLR_TIP%" -Dsolr.default.confdir="%DEFAULT_CONFDIR%" ^
-Dsolr.solr.home="%SOLR_HOME%" -Dsolr.install.dir="%SOLR_TIP%" -Dsolr.install.symDir="%SOLR_TIP%" ^
-Djetty.port=%SOLR_PORT% -Djetty.home="%SOLR_SERVER_DIR%" ^
-Djava.io.tmpdir="%SOLR_SERVER_DIR%\tmp" -jar start.jar %SOLR_JETTY_CONFIG% "%SOLR_JETTY_ADDL_CONFIG%"
) ELSE (
START /B "Solr-%SOLR_PORT%" /D "%SOLR_SERVER_DIR%" ^
"%JAVA%" %SERVEROPT% %SOLR_JAVA_MEM% %START_OPTS% ^
-Dlog4j.configurationFile="%LOG4J_CONFIG%" -DSTOP.PORT=!STOP_PORT! -DSTOP.KEY=%STOP_KEY% ^
-Dsolr.log.muteconsole ^
-Dsolr.solr.home="%SOLR_HOME%" -Dsolr.install.dir="%SOLR_TIP%" -Dsolr.install.symDir="%SOLR_TIP%" -Dsolr.default.confdir="%DEFAULT_CONFDIR%" ^
-Dsolr.solr.home="%SOLR_HOME%" -Dsolr.install.dir="%SOLR_TIP%" -Dsolr.install.symDir="%SOLR_TIP%" ^
-Djetty.port=%SOLR_PORT% -Djetty.home="%SOLR_SERVER_DIR%" ^
-Djava.io.tmpdir="%SOLR_SERVER_DIR%\tmp" -jar start.jar %SOLR_JETTY_CONFIG% "%SOLR_JETTY_ADDL_CONFIG%" > "!SOLR_LOGS_DIR!\solr-%SOLR_PORT%-console.log"
echo %SOLR_PORT%>"%SOLR_TIP%"\bin\solr-%SOLR_PORT%.port
Expand All @@ -1166,7 +1142,7 @@ IF "%FG%"=="1" (
set SOLR_START_WAIT=180
)
REM now wait to see Solr come online ...
"%JAVA%" %SOLR_SSL_OPTS% %AUTHC_OPTS% %SOLR_ZK_CREDS_AND_ACLS% %SOLR_TOOL_OPTS% -Dsolr.install.dir="%SOLR_TIP%" -Dsolr.default.confdir="%DEFAULT_CONFDIR%"^
"%JAVA%" %SOLR_SSL_OPTS% %AUTHC_OPTS% %SOLR_ZK_CREDS_AND_ACLS% %SOLR_TOOL_OPTS% -Dsolr.install.dir="%SOLR_TIP%" ^
-Dlog4j.configurationFile="file:///%DEFAULT_SERVER_DIR%\resources\log4j2-console.xml" ^
-classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^
org.apache.solr.cli.SolrCLI status --max-wait-secs !SOLR_START_WAIT!
Expand Down
2 changes: 1 addition & 1 deletion solr/core/src/java/org/apache/solr/cli/PackageTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ public String getHeader() {
"Note: (a) Please add '--solr-url http://host:port' parameter if needed (usually on Windows).");
format(
sb,
" (b) Please make sure that all Solr nodes are started with '-Denable.packages=true' parameter.");
" (b) Please make sure that all Solr nodes are started with '-Dsolr.enable.packages=true' parameter.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

solr.packages.enabled ?

format(sb, "\n");
format(sb, "List of options:");
return sb.toString();
Expand Down
2 changes: 1 addition & 1 deletion solr/core/src/java/org/apache/solr/core/CoreContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -1766,7 +1766,7 @@ private SolrCore createFromDescriptor(
// this mostly happens when the core is deleted when this node is down
// but it can also happen if connecting to the wrong zookeeper
final boolean deleteUnknownCores =
Boolean.parseBoolean(System.getProperty("solr.deleteUnknownCores", "false"));
Boolean.parseBoolean(System.getProperty("solr.delete.unknown.cores", "false"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

solr.cloud.startup.delete.unknown.cores.enabled?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see that this is a painfully long prop, and I kind of agree with Smiley that solr.cloud.startup.deleteUnknownCores would be a better choice. But allowing CamelCase breaks the simple translation rule that you can take an env.var and lowercase it and replace underscores with dots to get the sysprop. Perhaps we could introduce dashes like SOLR_CLOUD_STARTUP_DELETE-UNKNOWN-CORES but it soon gets to complex. Naming has been and is a hard thing.

I'm personally willing to embrace structure and simplified rules for parsing/mapping and sacrifice some readability or brewity. Perhaps further down the road we could build one very simple config parser that instantiates config objects without all the bolier-plate parsing code we have today.

log.error(
"SolrCore {} in {} is not in cluster state.{}",
dcore.getName(),
Expand Down
2 changes: 1 addition & 1 deletion solr/core/src/java/org/apache/solr/core/NodeConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ public static NodeConfig loadNodeConfig(Path solrHome, Properties nodeProperties
// ZkFailoverTest test case...
String zkHost = nodeProperties.getProperty(SolrXmlConfig.ZK_HOST);
if (StrUtils.isNotNullOrEmpty(zkHost)) {
int startUpZkTimeOut = 1000 * Integer.getInteger("waitForZk", 0);
int startUpZkTimeOut = 1000 * Integer.getInteger("solr.wait.for.zk", 0);
if (startUpZkTimeOut == 0) {
startUpZkTimeOut = SolrZkClientTimeout.DEFAULT_ZK_CLIENT_TIMEOUT;
}
Expand Down
Loading
Loading