From 0dbf31df5105146c98a7a68a693489e6be128c8a Mon Sep 17 00:00:00 2001 From: Yuntong Qu Date: Fri, 11 Oct 2024 11:30:08 -0600 Subject: [PATCH 01/62] ref guide: remove policy reference (#2755) --- .../modules/deployment-guide/pages/collection-management.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solr/solr-ref-guide/modules/deployment-guide/pages/collection-management.adoc b/solr/solr-ref-guide/modules/deployment-guide/pages/collection-management.adoc index 62634d79ea0..62f43f6d54e 100644 --- a/solr/solr-ref-guide/modules/deployment-guide/pages/collection-management.adoc +++ b/solr/solr-ref-guide/modules/deployment-guide/pages/collection-management.adoc @@ -989,7 +989,7 @@ There are additionally a number of optional parameters that determine the target If they are not specified in the request then their values are copied from the source collection. The following parameters are currently supported (described in detail in the <> section): `numShards`, `replicationFactor`, `nrtReplicas`, `tlogReplicas`, `pullReplicas`, -`shards`, `policy`, `createNodeSet`, `createNodeSet.shuffle`, `router.*`. +`shards`, `createNodeSet`, `createNodeSet.shuffle`, `router.*`. When the reindexing process has completed the target collection is marked using `property.rx: "finished"`, and the source collection state is updated to become read-write. From 19cf21e261b8dd01ee46581761f07c8062139d4d Mon Sep 17 00:00:00 2001 From: Eric Pugh Date: Fri, 11 Oct 2024 12:13:05 -0600 Subject: [PATCH 02/62] SOLR-17488: CLI: Resolve -d conflicts (#2754) --- solr/bin/solr | 12 +++++----- solr/bin/solr.cmd | 13 ++++++----- .../java/org/apache/solr/cli/DeleteTool.java | 15 +++++++++++++ .../java/org/apache/solr/cli/PostTool.java | 22 +++++++++++++++++-- .../org/apache/solr/cli/RunExampleTool.java | 2 +- .../pages/solr-control-script-reference.adoc | 16 +++++++------- .../indexing-guide/pages/post-tool.adoc | 2 +- 7 files changed, 59 insertions(+), 23 deletions(-) diff --git a/solr/bin/solr b/solr/bin/solr index d7b34d37f00..4ab26565e92 100755 --- a/solr/bin/solr +++ b/solr/bin/solr @@ -367,7 +367,7 @@ function print_usage() { if [[ "$CMD" == "start" || "$CMD" == "restart" ]]; then echo "" - echo "Usage: solr $CMD [-f] [-c] [--host host] [-p port] [-d directory] [-z zkHost] [-m memory] [-e example] [--solr-home solr.solr.home] [--data-home solr.data.home] [--jvm-opts \"jvm-opts\"] [-V]" + echo "Usage: solr $CMD [-f] [-c] [--host host] [-p port] [--server-dir directory] [-z zkHost] [-m memory] [-e example] [--solr-home solr.solr.home] [--data-home solr.data.home] [--jvm-opts \"jvm-opts\"] [-V]" echo "" echo " -f Start Solr in foreground; default starts Solr in the background" echo " and sends stdout / stderr to solr-PORT-console.log" @@ -383,7 +383,7 @@ function print_usage() { echo " STOP_PORT=(\$SOLR_PORT-1000) and JMX RMI listen port RMI_PORT=(\$SOLR_PORT+10000). " echo " For instance, if you set -p 8985, then the STOP_PORT=7985 and RMI_PORT=18985" echo "" - echo " -d Specify the Solr server directory; defaults to server" + echo " --server-dir Specify the Solr server directory; defaults to server" echo "" echo " -z/--zk-host Zookeeper connection string; only used when running in SolrCloud mode using -c" echo " If neither ZK_HOST is defined in solr.in.sh nor the -z parameter is specified," @@ -395,7 +395,7 @@ function print_usage() { echo "" echo " --solr-home Sets the solr.solr.home system property; Solr will create core directories under" echo " this directory. This allows you to run multiple Solr instances on the same host" - echo " while reusing the same server directory set using the -d parameter. If set, the" + echo " while reusing the same server directory set using the --server-dir parameter. If set, the" echo " specified directory should contain a solr.xml file, unless solr.xml exists in Zookeeper." echo " This parameter is ignored when running examples (-e), as the solr.solr.home depends" echo " on which example is run. The default value is server/solr. If passed relative dir," @@ -742,7 +742,7 @@ if [ $# -gt 0 ]; then PASS_TO_RUN_EXAMPLE+=("-c") shift ;; - -d|--dir|-dir) + -d|--dir|-dir|--server-dir) if [[ -z "$2" || "${2:0:1}" == "-" ]]; then print_usage "$SCRIPT_CMD" "Server directory is required when using the $1 option!" exit 1 @@ -930,7 +930,7 @@ fi # otherwise let this script proceed to process the user request # if [ -n "${EXAMPLE:-}" ] && [ "$SCRIPT_CMD" == "start" ]; then - run_tool run_example -e "$EXAMPLE" -d "$SOLR_SERVER_DIR" --url-scheme "$SOLR_URL_SCHEME" "${PASS_TO_RUN_EXAMPLE[@]}" + run_tool run_example -e "$EXAMPLE" --server-dir "$SOLR_SERVER_DIR" --url-scheme "$SOLR_URL_SCHEME" "${PASS_TO_RUN_EXAMPLE[@]}" exit $? fi @@ -1372,7 +1372,7 @@ function start_solr() { cd "$SOLR_SERVER_DIR" || (echo -e "\nCd to SOLR_SERVER_DIR failed" && exit 1) if [ ! -e "$SOLR_SERVER_DIR/start.jar" ]; then - echo -e "\nERROR: start.jar file not found in $SOLR_SERVER_DIR!\nPlease check your -d parameter to set the correct Solr server directory.\n" + echo -e "\nERROR: start.jar file not found in $SOLR_SERVER_DIR!\nPlease check your --server-dir parameter to set the correct Solr server directory.\n" exit 1 fi diff --git a/solr/bin/solr.cmd b/solr/bin/solr.cmd index 41efebf4163..84c578a10ee 100755 --- a/solr/bin/solr.cmd +++ b/solr/bin/solr.cmd @@ -307,7 +307,7 @@ goto done :start_usage @echo. -@echo Usage: solr %SCRIPT_CMD% [-f] [-c] [--host hostname] [-p port] [-d directory] [-z zkHost] [-m memory] [-e example] [--solr-home solr.solr.home] [--data-home solr.data.home] [--jvm-opts "jvm-opts"] [-V] +@echo Usage: solr %SCRIPT_CMD% [-f] [-c] [--host hostname] [-p port] [--server-dir directory] [-z zkHost] [-m memory] [-e example] [--solr-home solr.solr.home] [--data-home solr.data.home] [--jvm-opts "jvm-opts"] [-V] @echo. @echo -f Start Solr in foreground; default starts Solr in the background @echo and sends stdout / stderr to solr-PORT-console.log @@ -323,7 +323,7 @@ goto done @echo STOP_PORT=(%%SOLR_PORT%%-1000) and JMX RMI listen port RMI_PORT=(%%SOLR_PORT%%+10000). @echo For instance, if you set -p 8985, then the STOP_PORT=7985 and RMI_PORT=18985 @echo. -@echo -d dir Specify the Solr server directory; defaults to server +@echo --server-dir dir Specify the Solr server directory; defaults to server @echo. @echo -z zkHost Zookeeper connection string; only used when running in SolrCloud mode using -c @echo If neither ZK_HOST is defined in solr.in.cmd nor the -z parameter is specified, @@ -335,13 +335,13 @@ goto done @echo. @echo --solr.home dir Sets the solr.solr.home system property; Solr will create core directories under @echo this directory. This allows you to run multiple Solr instances on the same host -@echo while reusing the same server directory set using the -d parameter. If set, the +@echo while reusing the same server directory set using the --server-dir parameter. If set, the @echo specified directory should contain a solr.xml file, unless solr.xml exists in Zookeeper. @echo This parameter is ignored when running examples (-e), as the solr.solr.home depends @echo on which example is run. The default value is server/solr. If passed a relative dir @echo validation with the current dir will be done before trying the default server/^ @echo. -@echo --data-hone dir Sets the solr.data.home system property, where Solr will store index data in ^/data subdirectories. +@echo --data-home dir Sets the solr.data.home system property, where Solr will store index data in ^/data subdirectories. @echo If not set, Solr uses solr.solr.home for both config and data. @echo. @echo -e example Name of the example to run; available examples: @@ -406,6 +406,7 @@ IF "%1"=="-cloud" goto set_cloud_mode IF "%1"=="--cloud" goto set_cloud_mode IF "%1"=="-d" goto set_server_dir IF "%1"=="--dir" goto set_server_dir +IF "%1"=="--server-dir" goto set_server_dir IF "%1"=="-s" goto set_solr_home_dir IF "%1"=="--solr-home" goto set_solr_home_dir IF "%1"=="-t" goto set_solr_data_dir @@ -1202,7 +1203,7 @@ REM Run the requested example -Dlog4j.configurationFile="file:///%DEFAULT_SERVER_DIR%\resources\log4j2-console.xml" ^ -Dsolr.install.symDir="%SOLR_TIP%" ^ -classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^ - org.apache.solr.cli.SolrCLI run_example --script "%SDIR%\solr.cmd" -e %EXAMPLE% -d "%SOLR_SERVER_DIR%" ^ + org.apache.solr.cli.SolrCLI run_example --script "%SDIR%\solr.cmd" -e %EXAMPLE% --server-dir "%SOLR_SERVER_DIR%" ^ --url-scheme !SOLR_URL_SCHEME! !PASS_TO_RUN_EXAMPLE! REM End of run_example @@ -1520,7 +1521,9 @@ for %%a in (%*) do ( ) else ( set "option!option!=%%a" if "!option!" equ "-d" set "SOLR_SERVER_DIR=%%a" + if "!option!" equ "--server-dir" set "SOLR_SERVER_DIR=%%a" if "!option!" equ "-s" set "SOLR_HOME=%%a" + if "!option!" equ "--solr-home" set "SOLR_HOME=%%a" if not "!option!" equ "-s" if not "!option!" equ "-d" ( set "AUTH_PARAMS=!AUTH_PARAMS! !option! %%a" ) diff --git a/solr/core/src/java/org/apache/solr/cli/DeleteTool.java b/solr/core/src/java/org/apache/solr/cli/DeleteTool.java index 8608448187e..c89a3fb0301 100644 --- a/solr/core/src/java/org/apache/solr/cli/DeleteTool.java +++ b/solr/core/src/java/org/apache/solr/cli/DeleteTool.java @@ -81,6 +81,19 @@ public List