Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into SOLR-17505
Browse files Browse the repository at this point in the history
  • Loading branch information
epugh committed Oct 21, 2024
2 parents a5b157e + 018e4f4 commit 281842f
Show file tree
Hide file tree
Showing 36 changed files with 751 additions and 1,255 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Solr uses [Gradle](https://gradle.org/) for its build system. Here are some usef

```
cd ./solr/packaging/build/dev
bin/solr start -c
bin/solr start
```

- Open a web browser and go to http://localhost:8983/solr/ to access the Solr Admin interface. You can also use the `bin/solr` script to create and manage Solr collections. For example use the `bin/solr post` tool to index some sample data.
Expand All @@ -108,4 +108,3 @@ To get involved in the developer community:
- Slack: `#solr-dev` in the `the-asf` organization. Sign up at https://the-asf.slack.com/messages/CE70MDPMF
- [Issue Tracker (JIRA)](https://issues.apache.org/jira/browse/SOLR)
- IRC: `#solr-dev` on [libera.chat](https://web.libera.chat/?channels=#solr-dev)

2 changes: 0 additions & 2 deletions dev-tools/scripts/smokeTestRelease.py
Original file line number Diff line number Diff line change
Expand Up @@ -774,8 +774,6 @@ def testSolrExample(binaryDistPath, javaPath):
raise RuntimeError('Failed to run the techproducts example, check log for previous errors.')

os.chdir('example')
print(' test utf8...')
run('sh ./exampledocs/test_utf8.sh http://localhost:8983/solr/techproducts', 'utf8.log')
print(' run query...')
s = load('http://localhost:8983/solr/techproducts/select/?q=video')
if s.find('"numFound":3,') == -1:
Expand Down
6 changes: 6 additions & 0 deletions gradle/testing/randomization/policies/solr-tests.policy
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ grant {
permission java.lang.RuntimePermission "writeFileDescriptor";
// needed by hadoop http
permission java.lang.RuntimePermission "getProtectionDomain";
// SolrProcessMgr to list processes
permission java.lang.RuntimePermission "manageProcess";

// These two *have* to be spelled out a separate
permission java.lang.management.ManagementPermission "control";
Expand Down Expand Up @@ -250,6 +252,10 @@ grant {

// expanded to a wildcard if set, allows all networking everywhere
permission java.net.SocketPermission "${solr.internal.network.permission}", "accept,listen,connect,resolve";

// Run java
permission java.io.FilePermission "${java.home}${/}-", "execute";
permission java.io.FilePermission "C:\\Windows\\*\\wmic.exe", "execute";
};

// Grant all permissions to Gradle test runner classes.
Expand Down
2 changes: 2 additions & 0 deletions solr/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ Deprecation Removals

* SOLR-17400: Remove deprecated script snapshotcli.sh. bin/solr snapshot-* commands have replaced this. (Eric Pugh)

* SOLR-17494: Remove language specific writer types (i.e wt= ruby, python, php, and phps). (Eric Pugh)

Dependency Upgrades
---------------------
(No changes)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,7 @@ public class QueryResponseWriters {
public static class BenchState {

/** See {@link SolrCore#DEFAULT_RESPONSE_WRITERS} */
@Param({
CommonParams.JAVABIN,
CommonParams.JSON,
"cbor",
"smile",
"xml",
"python",
"phps",
"ruby",
"raw"
})
@Param({CommonParams.JAVABIN, CommonParams.JSON, "cbor", "smile", "xml", "raw"})
String wt;

private int docs = 100;
Expand Down
50 changes: 1 addition & 49 deletions solr/bin/solr
Original file line number Diff line number Diff line change
Expand Up @@ -493,55 +493,13 @@ function run_tool() {

# shellcheck disable=SC2086
"$JAVA" $SOLR_SSL_OPTS $AUTHC_OPTS ${SOLR_ZK_CREDS_AND_ACLS:-} ${SOLR_TOOL_OPTS:-} -Dsolr.install.dir="$SOLR_TIP" \
-Dlog4j.configurationFile="$DEFAULT_SERVER_DIR/resources/log4j2-console.xml" \
-Dlog4j.configurationFile="$DEFAULT_SERVER_DIR/resources/log4j2-console.xml" -Dsolr.pid.dir="$SOLR_PID_DIR" \
-classpath "$DEFAULT_SERVER_DIR/solr-webapp/webapp/WEB-INF/lib/*:$DEFAULT_SERVER_DIR/lib/ext/*:$DEFAULT_SERVER_DIR/lib/*" \
org.apache.solr.cli.SolrCLI "$@"

return $?
} # end run_tool function

# get status about any Solr nodes running on this host
function get_status() {
# first, see if Solr is running
numSolrs=$(find "$SOLR_PID_DIR" -name "solr-*.pid" -type f | wc -l | tr -d ' ')
if [ "$numSolrs" != "0" ]; then
echo -e "\nFound $numSolrs Solr nodes: "
while read PIDF
do
ID=$(cat "$PIDF")
port=$(jetty_port "$ID")
if [ "$port" != "" ]; then
echo -e "\nSolr process $ID running on port $port"
run_tool status --solr-url "$SOLR_URL_SCHEME://$SOLR_TOOL_HOST:$port" "$@"
echo ""
else
echo -e "\nSolr process $ID from $PIDF not found."
fi
done < <(find "$SOLR_PID_DIR" -name "solr-*.pid" -type f)
else
# no pid files but check using ps just to be sure
numSolrs=$(ps auxww | grep start\.jar | grep solr\.solr\.home | grep -v grep | wc -l | sed -e 's/^[ \t]*//')
if [ "$numSolrs" != "0" ]; then
echo -e "\nFound $numSolrs Solr nodes: "
PROCESSES=$(ps auxww | grep start\.jar | grep solr\.solr\.home | grep -v grep | awk '{print $2}' | sort -r)
for ID in $PROCESSES
do
port=$(jetty_port "$ID")
if [ "$port" != "" ]; then
echo ""
echo "Solr process $ID running on port $port"
run_tool status --solr-url "$SOLR_URL_SCHEME://$SOLR_TOOL_HOST:$port" "$@"
echo ""
fi
done
else
echo -e "\nNo Solr nodes are running.\n"
run_tool status "$@"
fi
fi

} # end get_status

# tries to gracefully stop Solr using the Jetty
# stop command and if that fails, then uses kill -9
# (will attempt to thread dump before killing)
Expand Down Expand Up @@ -632,12 +590,6 @@ else
exit
fi

# status tool
if [ "$SCRIPT_CMD" == "status" ]; then
get_status
exit $?
fi

# configure authentication
if [[ "$SCRIPT_CMD" == "auth" ]]; then
: "${SOLR_SERVER_DIR:=$DEFAULT_SERVER_DIR}"
Expand Down
30 changes: 1 addition & 29 deletions solr/bin/solr.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ IF "%1"=="-h" goto run_solrcli
IF "%1"=="--help" goto run_solrcli
IF "%1"=="-help" goto run_solrcli
IF "%1"=="/?" goto run_solrcli
IF "%1"=="status" goto get_status
IF "%1"=="status" goto run_solrcli
IF "%1"=="version" goto run_solrcli
IF "%1"=="-v" goto run_solrcli
IF "%1"=="-version" goto run_solrcli
Expand Down Expand Up @@ -1208,34 +1208,6 @@ REM Run the requested example
REM End of run_example
goto done

:get_status
REM Find all Java processes, correlate with those listening on a port
REM and then try to contact via that port using the status tool
for /f "usebackq" %%i in (`dir /b "%SOLR_TIP%\bin" ^| findstr /i "^solr-.*\.port$"`) do (
set SOME_SOLR_PORT=
For /F "Delims=" %%J In ('type "%SOLR_TIP%\bin\%%i"') do set SOME_SOLR_PORT=%%~J
if NOT "!SOME_SOLR_PORT!"=="" (
for /f "tokens=2,5" %%j in ('netstat -aon ^| find "TCP " ^| find ":0 " ^| find ":!SOME_SOLR_PORT! "') do (
IF NOT "%%k"=="0" (
if "%%j"=="%SOLR_JETTY_HOST%:!SOME_SOLR_PORT!" (
@echo.
set has_info=1
echo Found Solr process %%k running on port !SOME_SOLR_PORT!
REM Passing in %2 (-h or --help) directly is captured by a custom help path for usage output
"%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 --solr-url !SOLR_URL_SCHEME!://%SOLR_TOOL_HOST%:!SOME_SOLR_PORT! %2
@echo.
)
)
)
)
)
if NOT "!has_info!"=="1" echo No running Solr nodes found.
set has_info=
goto done

:run_solrcli
"%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" ^
Expand Down
2 changes: 1 addition & 1 deletion solr/core/src/java/org/apache/solr/cli/RunExampleTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ protected void runCloudExample(CommandLine cli) throws Exception {
// start the other nodes
for (int n = 1; n < numNodes; n++)
startSolr(
new File(cloudDir, "node" + (n + 1) + "/solr"), false, cli, cloudPorts[n], zkHost, 30);
new File(cloudDir, "node" + (n + 1) + "/solr"), true, cli, cloudPorts[n], zkHost, 30);
}

String solrUrl = (String) nodeStatus.get("baseUrl");
Expand Down
3 changes: 2 additions & 1 deletion solr/core/src/java/org/apache/solr/cli/SolrCLI.java
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,8 @@ public static String getOptionWithDeprecatedAndDefault(
// TODO: SOLR-17429 - remove the custom logic when Commons CLI is upgraded and
// makes stderr the default, or makes Option.toDeprecatedString() public.
private static void deprecatedHandlerStdErr(Option o) {
if (o.isDeprecated()) {
// Deprecated options without a description act as "stealth" options
if (o.isDeprecated() && !o.getDeprecated().getDescription().isBlank()) {
final StringBuilder buf =
new StringBuilder().append("Option '-").append(o.getOpt()).append('\'');
if (o.getLongOpt() != null) {
Expand Down
Loading

0 comments on commit 281842f

Please sign in to comment.