Skip to content

Commit

Permalink
Update deprecation warnings for default mode in bin/solr
Browse files Browse the repository at this point in the history
  • Loading branch information
malliaridis committed Oct 23, 2024
1 parent 90db103 commit b0e037d
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions solr/bin/solr
Original file line number Diff line number Diff line change
Expand Up @@ -775,8 +775,15 @@ if [ $# -gt 0 ]; then
-c|--cloud|-cloud)
SOLR_MODE="solrcloud"
PASS_TO_RUN_EXAMPLE+=("-c")

echo -e "Solr will start in SolrCloud mode by default in version 10, and you will no longer need to pass in -c or --cloud flag.\n"
shift
;;
--user-managed)
# Allow the user to use the user-managed flag to suppress the warning about th change
# of the default mode in v10.
SOLR_MODE="user-managed"
;;
-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!"
Expand Down Expand Up @@ -1181,11 +1188,18 @@ if [[ -n "${ZK_HOST:-}" ]]; then
SOLR_MODE="solrcloud"
fi

if [[ -z ${SOLR_MODE:-} ]]; then
# User has not provided any option for the mode (--cloud/--user-managed), therefore
# stay on user-managed mode in 9.x to avoid behavior changing / breaking changes
SOLR_MODE="user-managed"
# and notify that staying the default option (not providing --user-managed) will affect
# future execution
echo -e "Solr will start in SolrCloud mode by default in version 10, and you will have to provide --user-managed if you want to stay on the user-managed (aka. standalone) mode.\n"
fi

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, even if no -c or --cloud flag is specified.\n"

if [ -n "${ZK_HOST:-}" ]; then
CLOUD_MODE_OPTS+=("-DzkHost=$ZK_HOST")
Expand Down Expand Up @@ -1218,8 +1232,6 @@ 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 --user-managed flag to run in User Managed (aka Standalone) mode.\n"
fi

# Exit if old syntax found
Expand Down

0 comments on commit b0e037d

Please sign in to comment.