Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into SOLR-6962
Browse files Browse the repository at this point in the history
  • Loading branch information
epugh committed Sep 28, 2024
2 parents 2238468 + 00a3bf2 commit dc929d6
Show file tree
Hide file tree
Showing 214 changed files with 15,420 additions and 416 deletions.
4 changes: 4 additions & 0 deletions dev-docs/FAQ.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,7 @@ If you don't yet have an account, you have to ask for one in the 'users' or 'dev
* http://fucit.org/solr-jenkins-reports/failure-report.html
* https://ge.apache.org/scans/tests?search.relativeStartTime=P90D&search.rootProjectNames=solr*
* https://lists.apache.org[Solr mailing list archives especially builds]

=== How can I build the JavaDoc's and the Reference Guide?

Run `./gradlew buildLocalSite` to build the Javadoc's and the Reference Guide site.
4 changes: 2 additions & 2 deletions dev-tools/scripts/smokeTestRelease.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ def verifyUnpacked(java, artifact, unpackPath, gitRevision, version, testArgs):
expected_src_root_folders = ['buildSrc', 'dev-docs', 'dev-tools', 'gradle', 'help', 'solr']
expected_src_root_files = ['build.gradle', 'gradlew', 'gradlew.bat', 'settings.gradle', 'versions.lock', 'versions.props']
expected_src_solr_files = ['build.gradle']
expected_src_solr_folders = ['benchmark', 'bin', 'modules', 'api', 'core', 'docker', 'documentation', 'example', 'licenses', 'packaging', 'distribution', 'prometheus-exporter', 'server', 'solr-ref-guide', 'solrj', 'solrj-streaming', 'solrj-zookeeper', 'test-framework', 'webapp', '.gitignore', '.gitattributes']
expected_src_solr_folders = ['benchmark', 'bin', 'modules', 'api', 'core', 'cross-dc-manager', 'docker', 'documentation', 'example', 'licenses', 'packaging', 'distribution', 'prometheus-exporter', 'server', 'solr-ref-guide', 'solrj', 'solrj-streaming', 'solrj-zookeeper', 'test-framework', 'webapp', '.gitignore', '.gitattributes']
is_in_list(in_root_folder, expected_src_root_folders)
is_in_list(in_root_folder, expected_src_root_files)
is_in_list(in_solr_folder, expected_src_solr_folders)
Expand All @@ -638,7 +638,7 @@ def verifyUnpacked(java, artifact, unpackPath, gitRevision, version, testArgs):
elif isSlim:
is_in_list(in_root_folder, ['bin', 'docker', 'docs', 'example', 'licenses', 'server', 'lib'])
else:
is_in_list(in_root_folder, ['bin', 'modules', 'docker', 'prometheus-exporter', 'docs', 'example', 'licenses', 'server', 'lib'])
is_in_list(in_root_folder, ['bin', 'modules', 'cross-dc-manager', 'docker', 'prometheus-exporter', 'docs', 'example', 'licenses', 'server', 'lib'])

if len(in_root_folder) > 0:
raise RuntimeError('solr: unexpected files/dirs in artifact %s: %s' % (artifact, in_root_folder))
Expand Down
1 change: 1 addition & 0 deletions gradle/maven/defaults-maven.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ configure(rootProject) {
ext {
published = [
":solr:api",
":solr:cross-dc-manager",
":solr:core",
":solr:solrj",
":solr:solrj-streaming",
Expand Down
10 changes: 8 additions & 2 deletions gradle/solr/packaging.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@
// I don't know how to untie these two cleanly.
//

configure(allprojects.findAll {project -> project.path.startsWith(":solr:modules:") || project.path.startsWith(":solr:prometheus-exporter") }) {
configure(allprojects.findAll {project -> project.path.startsWith(":solr:modules:") || project.path == ":solr:prometheus-exporter" || project.path == ":solr:cross-dc-manager" }) {
plugins.withType(JavaPlugin) {
ext {
packagingDir = file("${buildDir}/packaging")
if (project.path.startsWith(":solr:prometheus-exporter")) {
if (project.path.startsWith(":solr:prometheus-exporter") || project.path.startsWith(":solr:cross-dc-manager")) {
deps = packagingDir
} else {
deps = file("${packagingDir}/${project.name}")
Expand All @@ -62,6 +62,12 @@ configure(allprojects.findAll {project -> project.path.startsWith(":solr:modules
solrPlatformLibs project(":solr:solrj-zookeeper")
// libExt has logging libs, which we don't want. Lets users decide what they want.
solrPlatformLibs project(path: ":solr:server", configuration: 'libExt')

// The cross-dc-manager uses the cross-dc Solr module libraries as well as the Jetty server jars
if (project.path == ":solr:cross-dc-manager") {
solrPlatformLibs project(":solr:modules:cross-dc")
solrPlatformLibs project(path: ":solr:server", configuration: 'serverLib')
}
}

// An aggregate that configures lib and test-lib in a temporary location.
Expand Down
7 changes: 6 additions & 1 deletion gradle/testing/randomization.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,12 @@ allprojects {

// Enable security manager, if requested. We could move the selection of security manager and security policy
// to each project's build/ configuration but it seems compact enough to keep it here for now.
if (Boolean.parseBoolean(testOptionsResolved["tests.useSecurityManager"])) {
def useSecurityManager = Boolean.parseBoolean(testOptionsResolved["tests.useSecurityManager"]);
// Allow the project to override this
if (project.ext.has("useSecurityManager")) {
useSecurityManager = project.ext.get("useSecurityManager")
}
if (useSecurityManager) {
def commonSolrDir = project(':solr').layout.projectDirectory
def javaSecurityPolicy = layout.projectDirectory.file("${resources}/policies/solr-tests.policy")
jvmArgumentProviders.add(
Expand Down
8 changes: 8 additions & 0 deletions gradle/testing/randomization/policies/solr-tests.policy
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,12 @@ grant {
// needed by bytebuddy
permission java.lang.RuntimePermission "defineClass";
permission java.lang.RuntimePermission "net.bytebuddy.createJavaDispatcher";
permission java.lang.RuntimePermission "net.bytebuddy.agent.getInstrumentation";
permission java.lang.reflect.ReflectPermission "newProxyInPackage.net.bytebuddy.description.method";
permission java.lang.reflect.ReflectPermission "newProxyInPackage.net.bytebuddy.description.type";
permission java.lang.reflect.ReflectPermission "newProxyInPackage.net.bytebuddy.dynamic.loading";
permission java.lang.reflect.ReflectPermission "newProxyInPackage.net.bytebuddy.utility";

// needed by mockito
permission java.lang.RuntimePermission "accessClassInPackage.sun.reflect";
permission java.lang.RuntimePermission "reflectionFactoryAccess";
Expand Down Expand Up @@ -153,6 +155,12 @@ grant {
// needed by s3mock
permission java.lang.RuntimePermission "accessClassInPackage.sun.nio.fs";

// needed for kafka mockito
permission java.lang.RuntimePermission "manageProcess";
permission java.io.FilePermission "${/}proc${/}self${/}io", "read";
permission java.io.FilePermission "${java.home}${/}bin${/}java", "execute";
permission java.io.FilePermission "${java.home}${/}bin${/}java.exe", "execute";

// SSL related properties for Solr tests
permission javax.net.ssl.SSLPermission "setDefaultSSLContext";

Expand Down
2 changes: 1 addition & 1 deletion gradle/validation/validate-log-calls.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class ValidateLogCallsTask extends DefaultTask {

if (hasPlus) {
cause = "hasPlus: " + hasPlus
violation = true
violation = level != "error"
}
if (violation == false) {
def m = stripped =~ "\\(.*?\\)"
Expand Down
2 changes: 2 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ include "solr:solrj"
include "solr:solrj-zookeeper"
include "solr:solrj-streaming"
include "solr:core"
include "solr:cross-dc-manager"
include "solr:server"
include "solr:modules:analysis-extras"
include "solr:modules:clustering"
include "solr:modules:cross-dc"
include "solr:modules:opentelemetry"
include "solr:modules:extraction"
include "solr:modules:gcs-repository"
Expand Down
26 changes: 25 additions & 1 deletion solr/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ Other Changes
================== 9.8.0 ==================
New Features
---------------------
(No changes)
* SOLR-17065: The Solr Cross-DC Project has graduated from the sandbox repository.
It will now be released as a fully supported Solr feature.
This feature closes SIP-13: Cross Data Center Replication. (Mark Miller, Andrzej Bialecki, Jason Gerlowski, Houston Putman)

Improvements
---------------------
Expand All @@ -119,6 +121,8 @@ Improvements

* SOLR-17382: Deprecate -a and -addlopts in favour of --jvm-opts for passing options into the JVM in bin/solr. (Eric Pugh, Christos Malliaridis)

* SOLR-17431: Deprecate -p parameter where it doesn't refer to a port in bin/solr. (Eric Pugh, Christos Malliaridis)

Optimizations
---------------------
* SOLR-14985: Solrj CloudSolrClient with Solr URLs had serious performance regressions (since the
Expand All @@ -138,6 +142,8 @@ Optimizations

* SOLR-3913: Optimize PostTool to call just optimize when both commit and optimize requested. (Eric Pugh)

* SOLR-17441: Improve system metrics collection by skipping unreadable MXBean properties, making /admin/info/system calls faster (Haythem Khiri)

Bug Fixes
---------------------
* SOLR-12429: Uploading a configset with a symbolic link produces a IOException. Now a error message to user generated instead. (Eric Pugh)
Expand All @@ -147,6 +153,8 @@ Bug Fixes

* SOLR-17416: Fixed ExportHandler bug that silently suppressed errors and returned partial results in some situations (hossman)

* SOLR-16254: Clarify when a bin/solr create needs to be run on the same server as Solr. (Eric Pugh)

Dependency Upgrades
---------------------
(No changes)
Expand All @@ -159,6 +167,10 @@ Other Changes

* SOLR-17142: Fix Gradle build sometimes gives spurious "unreferenced license file" warnings. (Uwe Schindler)

* SOLR-17448: Fixed inadvertent suppression of exceptions in the background tasks across the codebase. For certain
tasks that were scheduled via ExecutorService#submit, the results of the task execution were never examined which
led to the suppression of exceptions. (Andrey Bozhko)

* SOLR-11318: Introduce unit testing for AssertTool. (Eric Pugh, Jason Gerlowski)

================== 9.7.0 ==================
Expand Down Expand Up @@ -2639,6 +2651,18 @@ Bug Fixes

* SOLR-16164: ConfigSet API returns error if untrusted user creates from _default configset (Eric Pugh, Kevin Risden)

================== 8.11.4 ==================

Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.

Bug Fixes
---------------------
* SOLR-17168: Add netty-transport-classes-epoll dependency (Colvin Cowie)

* SOLR-17417: Remove unnecessary code in PKIAuthPlugin and HttpSolrCall (Houston Putman, janhoy, Liu Huajin)

* SOLR-17418: Streamline ConfigSet modification logic. (Houston Putman, Liu Huajin)

================== 8.11.3 ==================

Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.
Expand Down
3 changes: 3 additions & 0 deletions solr/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ Benchmarking module for Solr.
link:bin/[]::
Scripts to start up, manage and interact with Solr instances.
link:cross-dc-manager/[]::
Contains a separate application to manage Cross-Datacenter indexing.
link:core/[]::
Base Solr code.
Expand Down
5 changes: 1 addition & 4 deletions solr/benchmark/src/java/org/apache/solr/bench/Docs.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,7 @@ public Iterator<SolrInputDocument> preGenerate(int numDocs) throws InterruptedEx
new SolrNamedThreadFactory("SolrJMH DocMaker"));

for (int i = 0; i < numDocs; i++) {
executorService.submit(
() -> {
docs.add(Docs.this.inputDocument());
});
executorService.execute(() -> docs.add(Docs.this.inputDocument()));
}

executorService.shutdown();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ private void indexParallel(String collection, Docs docs, int docCount)
10,
TimeUnit.SECONDS);
for (int i = 0; i < docCount; i++) {
executorService.submit(
executorService.execute(
new Runnable() {
final SplittableRandom threadRandom = random.split();

Expand Down
2 changes: 1 addition & 1 deletion solr/core/src/java/org/apache/solr/cli/AuthTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public String getUsage() {

@Override
public String getHeader() {
return "\nUpdates or enables/disables authentication. Must be run on the machine hosting Solr.\n"
return "Updates or enables/disables authentication. Must be run on the Solr server itself.\n"
+ "\n"
+ "List of options:";
}
Expand Down
27 changes: 24 additions & 3 deletions solr/core/src/java/org/apache/solr/cli/ConfigTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import java.util.List;
import java.util.Map;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.DeprecatedAttributes;
import org.apache.commons.cli.MissingArgumentException;
import org.apache.commons.cli.Option;
import org.apache.solr.client.solrj.SolrClient;
import org.apache.solr.common.util.NamedList;
Expand Down Expand Up @@ -66,11 +68,26 @@ public List<Option> getOptions() {
.desc(
"Config API action, one of: set-property, unset-property, set-user-property, unset-user-property; default is 'set-property'.")
.build(),
Option.builder("p")
Option.builder()
.longOpt("property")
.argName("PROP")
.hasArg()
.required(true)
.required(
false) // Should be TRUE but have a deprecated option to deal with first, so we
// enforce in code
.desc(
"Name of the Config API property to apply the action to, such as: 'updateHandler.autoSoftCommit.maxTime'.")
.build(),
Option.builder("p")
.deprecated(
DeprecatedAttributes.builder()
.setForRemoval(true)
.setSince("9.8")
.setDescription("Use --property instead")
.get())
.hasArg()
.argName("PROP")
.required(false)
.desc(
"Name of the Config API property to apply the action to, such as: 'updateHandler.autoSoftCommit.maxTime'.")
.build(),
Expand All @@ -93,9 +110,13 @@ public void runImpl(CommandLine cli) throws Exception {
String solrUrl = SolrCLI.normalizeSolrUrl(cli);
String action = cli.getOptionValue("action", "set-property");
String collection = cli.getOptionValue("name");
String property = cli.getOptionValue("property");
String property = SolrCLI.getOptionWithDeprecatedAndDefault(cli, "property", "p", null);
String value = cli.getOptionValue("value");

if (property == null) {
throw new MissingArgumentException("'property' is a required option.");
}

Map<String, Object> jsonObj = new HashMap<>();
if (value != null) {
Map<String, String> setMap = new HashMap<>();
Expand Down
8 changes: 8 additions & 0 deletions solr/core/src/java/org/apache/solr/cli/CreateTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ public String getName() {
return "create";
}

@Override
public String getHeader() {
return "Creates a core or collection depending on whether Solr is running in standalone (core) or SolrCloud mode (collection).\n"
+ "If you are using standalone mode you must run this command on the Solr server itself.\n"
+ "\n"
+ "List of options:";
}

@Override
public List<Option> getOptions() {
return List.of(
Expand Down
2 changes: 1 addition & 1 deletion solr/core/src/java/org/apache/solr/cli/DeleteTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public String getName() {

@Override
public String getHeader() {
return "\nDeletes a core or collection depending on whether Solr is running in standalone (core) or SolrCloud"
return "Deletes a core or collection depending on whether Solr is running in standalone (core) or SolrCloud"
+ " mode (collection). If you're deleting a collection in SolrCloud mode, the default behavior is to also"
+ " delete the configuration directory from Zookeeper so long as it is not being used by another collection.\n"
+ " You can override this behavior by passing -deleteConfig false when running this command.\n"
Expand Down
4 changes: 2 additions & 2 deletions solr/core/src/java/org/apache/solr/cli/ExportTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ void exportDocs() throws Exception {
CountDownLatch producerLatch = new CountDownLatch(corehandlers.size());
corehandlers.forEach(
(s, coreHandler) ->
producerThreadpool.submit(
producerThreadpool.execute(
() -> {
try {
coreHandler.exportDocsFromCore();
Expand Down Expand Up @@ -585,7 +585,7 @@ private void addProducers(Map<String, Slice> m) {
}

private void addConsumer(CountDownLatch consumerlatch) {
consumerThreadpool.submit(
consumerThreadpool.execute(
() -> {
while (true) {
SolrDocument doc;
Expand Down
27 changes: 22 additions & 5 deletions solr/core/src/java/org/apache/solr/cli/PackageTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.util.List;
import java.util.Map;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.DeprecatedAttributes;
import org.apache.commons.cli.Option;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.core.config.Configurator;
Expand Down Expand Up @@ -124,7 +125,7 @@ public void runImpl(CommandLine cli) throws Exception {
printGreen("\t" + packages.get(packageName));
}
} else {
// nuance that we use a arg here instead of requiring a --package parameter with a
// nuance that we use an arg here instead of requiring a --package parameter with a
// value
// in this code path
String packageName = cli.getArgs()[1];
Expand Down Expand Up @@ -166,21 +167,25 @@ public void runImpl(CommandLine cli) throws Exception {
Pair<String, String> parsedVersion = parsePackageVersion(cli.getArgList().get(1));
String packageName = parsedVersion.first();
String version = parsedVersion.second();
boolean noprompt = cli.hasOption("no-prompt");
boolean noPrompt = cli.hasOption("no-prompt");
boolean isUpdate = cli.hasOption("update");
String[] collections =
cli.hasOption("collections")
? PackageUtils.validateCollections(
cli.getOptionValue("collections").split(","))
: new String[] {};
String[] parameters =
cli.hasOption("param")
? cli.getOptionValues("param")
: cli.getOptionValues("p");
packageManager.deploy(
packageName,
version,
collections,
cli.hasOption("cluster"),
cli.getOptionValues("param"),
parameters,
isUpdate,
noprompt);
noPrompt);
} else {
printRed(
"Either specify --cluster to deploy cluster level plugins or --collections <list-of-collections> to deploy collection level plugins");
Expand Down Expand Up @@ -330,12 +335,24 @@ public List<Option> getOptions() {
.longOpt("cluster")
.desc("Specifies that this action should affect cluster-level plugins only.")
.build(),
Option.builder("p")
Option.builder()
.longOpt("param")
.hasArgs()
.argName("PARAMS")
.desc("List of parameters to be used with deploy command.")
.build(),
Option.builder("p")
.deprecated(
DeprecatedAttributes.builder()
.setForRemoval(true)
.setSince("9.8")
.setDescription("Use --param instead")
.get())
.hasArg()
.argName("PARAMS")
.required(false)
.desc("List of parameters to be used with deploy command.")
.build(),
Option.builder()
.longOpt("update")
.desc("If a deployment is an update over a previous deployment.")
Expand Down
Loading

0 comments on commit dc929d6

Please sign in to comment.