Skip to content

Commit

Permalink
Inform 9x users about upcoming change to solrcloud default mode
Browse files Browse the repository at this point in the history
  • Loading branch information
epugh committed Sep 29, 2024
1 parent 8fdded4 commit f0b156e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions solr/bin/solr
Original file line number Diff line number Diff line change
Expand Up @@ -1185,6 +1185,8 @@ if [ "${SOLR_MODE:-}" == 'solrcloud' ]; then
: "${ZK_CLIENT_TIMEOUT:=30000}"
CLOUD_MODE_OPTS=("-DzkClientTimeout=$ZK_CLIENT_TIMEOUT")

echo -e "\nSolr will start in SolrCloud mode by default in version 10, and you will no longer need to pass in -c or --cloud flag.\n"

if [ -n "${ZK_HOST:-}" ]; then
CLOUD_MODE_OPTS+=("-DzkHost=$ZK_HOST")
else
Expand Down Expand Up @@ -1216,6 +1218,8 @@ else
echo -e "\nSolr home directory $SOLR_HOME must contain a solr.xml file!\n"
exit 1
fi

echo -e "\nSolr will start in SolrCloud mode by default in version 10. You will need to pass in --standalone flag to run in Standalone mode.\n"
fi

# Exit if old syntax found
Expand Down
2 changes: 2 additions & 0 deletions solr/bin/solr.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -950,6 +950,7 @@ if !JAVA_MAJOR_VERSION! LSS 9 (
IF NOT "%ZK_HOST%"=="" set SOLR_MODE=solrcloud

IF "%SOLR_MODE%"=="solrcloud" (
@echo Solr will start in SolrCloud mode by default in version 10, and you will no longer need to pass in -c or --cloud flag.
IF "%ZK_CLIENT_TIMEOUT%"=="" set "ZK_CLIENT_TIMEOUT=30000"

set "CLOUD_MODE_OPTS=-DzkClientTimeout=!ZK_CLIENT_TIMEOUT!"
Expand Down Expand Up @@ -984,6 +985,7 @@ IF "%SOLR_MODE%"=="solrcloud" (
IF EXIST "%SOLR_HOME%\collection1\core.properties" set "CLOUD_MODE_OPTS=!CLOUD_MODE_OPTS! -Dbootstrap_confdir=./solr/collection1/conf -Dcollection.configName=myconf -DnumShards=1"
) ELSE (
set CLOUD_MODE_OPTS=
@echo Solr will start in SolrCloud mode by default in version 10. You will need to pass in --standalone flag to run in Standalone mode.
IF NOT EXIST "%SOLR_HOME%\solr.xml" (
IF "%SOLR_SOLRXML_REQUIRED%"=="true" (
set "SCRIPT_ERROR=Solr home directory %SOLR_HOME% must contain solr.xml!"
Expand Down
7 changes: 7 additions & 0 deletions solr/packaging/test/test_start_solr.bats
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ teardown() {

}

@test "start provides warning about SolrCloud mode" {
run solr start
solr assert --started http://localhost:${SOLR_PORT} --timeout 5000
assert_output --partial 'Solr will start in SolrCloud mode by default in version 10. You will need to pass in --standalone flag to run in Standalone mode.'
solr stop
}

@test "check stop command doesn't hang" {
# for start/stop/restart we parse the args separate from picking the command
# which means you don't get an error message for passing a start arg, like --jvm-opts to a stop commmand.
Expand Down

0 comments on commit f0b156e

Please sign in to comment.