Skip to content

Commit

Permalink
Merge branch 'apache:main' into feature/SOLR-17334
Browse files Browse the repository at this point in the history
  • Loading branch information
ellaeln authored Aug 13, 2024
2 parents 1332b32 + 8ddc3be commit e918d70
Show file tree
Hide file tree
Showing 162 changed files with 1,815 additions and 1,423 deletions.
1 change: 1 addition & 0 deletions .asf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ github:
branch_9_4: {}
branch_9_5: {}
branch_9_6: {}
branch_9_7: {}
branch_9x: {}

protected_tags:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/bin-solr-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- 'solr/bin/**'
- 'solr/packaging/**'
- 'solr/core/src/java/org/apache/solr/cli/**'
- 'solr/prometheus-exporter/**'

jobs:
test:
Expand Down Expand Up @@ -47,4 +48,3 @@ jobs:
with:
name: logs
path: solr/packaging/build/test-output

2 changes: 1 addition & 1 deletion .github/workflows/gradle-precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ jobs:
- name: Run gradle check (without tests)
run: ./gradlew check -x test -Ptask.times=true

- uses: gradle/wrapper-validation-action@v2
- uses: gradle/wrapper-validation-action@v3
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
Solr is the popular, blazing fast open source search platform for all your
enterprise, e-commerce, and analytics needs, built on [Apache Lucene](https://lucene.apache.org/).

[![Build Status](https://ci-builds.apache.org/job/Solr/job/Solr-Artifacts-main/badge/icon?subject=Solr%20Artifacts)](https://ci-builds.apache.org/job/Solr/job/Solr-Artifacts-main/)
[![Build Status](https://ci-builds.apache.org/job/Solr/job/Solr-Check-main/badge/icon?subject=Solr%20Check)](https://ci-builds.apache.org/job/Solr/job/Solr-Check-main/)

For a complete description of the Solr project, team composition, source
code repositories, and other details, please see the Solr web site at
https://solr.apache.org/
Expand Down
2 changes: 1 addition & 1 deletion dev-tools/scripts/releaseWizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -1123,7 +1123,7 @@ def file_to_string(filename):
return f.read().strip()

def download_keys():
download('KEYS', "https://archive.apache.org/dist/solr/KEYS", state.config_path)
download('KEYS', "https://downloads.apache.org/solr/KEYS", state.config_path)

def keys_downloaded():
return os.path.exists(os.path.join(state.config_path, "KEYS"))
Expand Down
2 changes: 1 addition & 1 deletion dev-tools/scripts/releaseWizard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ groups:
{% if release_type == 'major' -%}
. Change name of version `main ({{ release_version_major }}.0)` into `{{ release_version_major }}.0`
{%- endif %}
. Create a new (unreleased) version `{{ get_next_version }}`
. Create a new (unreleased) version `{{ release_version_major }}.{{ release_version_minor + 1 }}`
types:
- major
- minor
Expand Down
67 changes: 57 additions & 10 deletions solr/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,45 @@ Other Changes

* SOLR-17279: Introduce SecurityJson.java file to Test Framework to consolidate setting up authentication in tests. (Rudy Seitz via Eric Pugh)

================== 9.8.0 ==================
New Features
---------------------
(No changes)

Improvements
---------------------
* SOLR-17397: SkipExistingDocumentsProcessor now functions correctly with child documents. (Tim Owens via Eric Pugh)

Optimizations
---------------------
* SOLR-14985: Solrj CloudSolrClient with Solr URLs had serious performance regressions (since the
beginning?) in which its collection state cache was not being used, resulting in many extra
requests to Solr for cluster information. (Aparna Suresh, shalin, David Smiley)

* SOLR-17102: The VersionBucket indexing lock mechanism was replaced with something just as fast yet
that which consumes almost no memory, saving 1MB of memory per SolrCore. (David Smiley)

* SOLR-17381: Make CLUSTERSTATUS request configurable to improve performance by allowing retrieval of specific information,
reducing unnecessary data fetching. (Aparna Suresh, David Smiley)

* SOLR-17396: Reduce thread contention in ZkStateReader.getCollectionProperties(). (Aparna Suresh, David Smiley, Paul McArthur)

Bug Fixes
---------------------
(No changes)

Dependency Upgrades
---------------------
(No changes)

Other Changes
---------------------
(No changes)

================== 9.7.0 ==================
New Features
---------------------
* SOLR-13350: Multithreaded search execution (Ishan Chattopadhyaya, Mark Miller, Christine Poerschke, David Smiley, noble)
* SOLR-13350, SOLR-17298: Opt-in multithreaded search execution (Ishan Chattopadhyaya, Mark Miller, Christine Poerschke, David Smiley, noble, Gus Heck)

* SOLR-17192: Put an UpdateRequestProcessor-enforced soft-limit on the number of fields allowed in a core. The `NumFieldLimitingUpdateRequestProcessorFactory`
limit may be adjusted by raising the factory's `maxFields` setting, toggled in and out of "warning-only" mode using the `warnOnly` setting, or disabled entirely
Expand All @@ -124,8 +159,18 @@ New Features

* SOLR-10255: Add support for docValues to solr.BinaryField. (Alexey Serba via Mikhail Khludnev, David Smiley)

* SOLR-17276: Prometheus Exporter: now scrapes metrics at a fixed rate instead of delay. (Rafał Harabień)

Improvements
---------------------
* SOLR-10808, SOLR-12963: The Solr schema version has been increased to 1.7.
Starting in schema version 1.7, most fields/fieldTypes that support docValues will have them enabled by default.
These field types include primitive (Numeric, Date, Bool, String, Enum, UUID), sorting (SortableTextField, SortableBinaryField, CollationField, ICUCollationField) and LatLonPointSpacialField.
This behavior can be reverted by setting the 'docValues' parameter for a field or a field type to false, the default for schema versions 1.6 and below.
Also in schema version 1.7, all fields/fieldTypes will be unable to be uninverted by default.
This behavior can be reverted by setting the 'uninvertible' parameter for a field or a field type to true, the default for schema versions 1.6 and below.
(Houston Putman, hossman)

* SOLR-17137: Enable Prometheus exporter to communicate with SSL protected Solr. (Eivind Bergstøl via Eric Pugh)

* SOLR-16921: use -solrUrl to derive the zk host connection for bin/solr zk subcommands (Eric Pugh)
Expand All @@ -146,7 +191,7 @@ Improvements

* SOLR-16824: Adopt Linux standard pattern of -- for long option commands, and make all commands "kebab" formatting. I.e -zkHost is now -zk-host. The old parameters
such as -zkHost continue to be supported in the 9.x line of Solr. -u is now used to specify user credentials everywhere, this only impacts the bin/solr assert
commands "same user" check which has -u as the short form of --same-user. (Eric Pugh, janhoy, Jason Gerlowski)
commands "same user" check which has -u as the short form of --same-user. (Eric Pugh, janhoy, Jason Gerlowski, Christos Malliaridis)

* SOLR-17346: Synchronise stopwords from snowball with those in Lucene (Alastair Porter via Houston Putman)

Expand All @@ -156,13 +201,6 @@ Improvements
Statuses are now removed 5 minutes after the read of a completed/failed status. Helps collection
async backup/restore and other operations scale to 100+ shards. (Pierre Salagnac, David Smiley)

* SOLR-10808, SOLR-12963: The Solr schema version has been increased to 1.7.
Starting in schema version 1.7, all fields/fieldTypes that support docValues will have them enabled by default.
This behavior can be reverted by setting the 'docValues' parameter for a field or a field type to false, the default for schema versions 1.6 and below.
Also in schema version 1.7, all fields/fieldTypes will be unable to be uninverted by default.
This behavior can be reverted by setting the 'uninvertible' parameter for a field or a field type to true, the default for schema versions 1.6 and below.
(Houston Putman, hossman)

* SOLR-10808 : The Solr schema version has been increased to 1.7. Since schema version 1.7, all fields/fieldTypes that
support docValues will have them enabled by default. This behavior can be reverted by setting
'docValues' parameter for a field or a field type to false, the default for schema versions 1.6 and below. (Houston Putman)
Expand All @@ -174,7 +212,7 @@ Optimizations

* SOLR-17099: Do not return spurious tags when fetching metrics from a Solr node to another. (Pierre Salagnac)

* SOLR-17269: Prevent the "Coordinator node" feature from registering synthetic cores in ZooKeeper (Patson Luk)
* SOLR-17269, SOLR-17386: Prevent the "Coordinator node" feature from registering synthetic cores in ZooKeeper (ellaeln, Patson Luk, David Smiley, Christine Poerschke)

* SOLR-17330: When not set, loadOnStartup defaults to true, which is the default choice for a core. (Pierre Salagnac via Eric Pugh)

Expand Down Expand Up @@ -221,6 +259,12 @@ Bug Fixes

* SOLR-17337: Display all custom distributed stages in debug output. (Torsten Bøgh Köster, Christine Poerschke)

* SOLR-17394: Detect and handle non-200 HTTP status codes for requests made by IndexFetcher (Jason Gerlowski)

* SOLR-17391: Fixed performance regression of misconfigured threadpools from SOLR-16879 (Solr 9.4).
Shard splits and concurrent/large collection backup/restore performance was serial. UpdateLog
replay was a little suboptimal in thread usage too. (Pierre Salagnac, Hakan Özler, David Smiley)

Dependency Upgrades
---------------------
(No changes)
Expand Down Expand Up @@ -252,6 +296,9 @@ Other Changes
* SOLR-17322: Once again allow rank queries to use custom TopDocsCollectors that operate on types that extend
ScoreDocs (covariant generic types) broken in Solr 9.0. (Stephen Woods via Christine Poerschke)

* SOLR-16996: Update Solr Exporter for Prometheus cli to use commons-cli instead of argparse4j. (Christos Malliaridis via Eric Pugh)


================== 9.6.1 ==================
Bug Fixes
---------------------
Expand Down
8 changes: 4 additions & 4 deletions solr/bin/solr.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ set FIRST_ARG=%1

IF [%1]==[] goto usage

REM -help is a special case to faciliate folks learning about how to use Solr.
IF "%1"=="-help" goto run_solrcli
IF "%1"=="-usage" goto run_solrcli
IF "%1"=="-h" goto run_solrcli
Expand Down Expand Up @@ -293,7 +294,6 @@ IF "%FIRST_ARG%"=="-help" goto run_solrcli
IF "%FIRST_ARG%"=="-usage" goto run_solrcli
IF "%FIRST_ARG%"=="-h" goto run_solrcli
IF "%FIRST_ARG%"=="--help" goto run_solrcli
IF "%FIRST_ARG%"=="-help" goto run_solrcli
IF "%FIRST_ARG%"=="/?" goto run_solrcli
IF "%SCRIPT_CMD%"=="start" goto start_usage
IF "%SCRIPT_CMD%"=="restart" goto start_usage
Expand All @@ -316,7 +316,7 @@ goto done
@echo -f Start Solr in foreground; default starts Solr in the background
@echo and sends stdout / stderr to solr-PORT-console.log
@echo.
@echo -c or -cloud Start Solr in SolrCloud mode; if -z not supplied and ZK_HOST not defined in
@echo -c or --cloud Start Solr in SolrCloud mode; if -z not supplied and ZK_HOST not defined in
@echo solr.in.cmd, an embedded ZooKeeper instance is started on Solr port+1000,
@echo such as 9983 if Solr is bound to 8983
@echo.
Expand Down Expand Up @@ -1493,10 +1493,10 @@ IF "!ZK_OP!"=="" (
set CONNECTION_PARAMS=""

IF "!ZK_OP!"=="" (
set CONNECTION_PARAMS="-solrUrl !ZK_SOLR_URL!"
set CONNECTION_PARAMS="--solr-url !ZK_SOLR_URL!"
)
ELSE (
set CONNECTION_PARAMS="-zkHost ZK_HOST!"
set CONNECTION_PARAMS="--zk-host ZK_HOST!"
)

IF "!ZK_OP!"=="upconfig" (
Expand Down
2 changes: 1 addition & 1 deletion solr/core/src/java/org/apache/solr/cli/CreateTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ private void printDefaultConfigsetWarningIfNecessary(CommandLine cli) {
final String configCommand =
String.format(
Locale.ROOT,
"bin/solr config -c %s -solrUrl %s -action set-user-property -property update.autoCreateFields -value false",
"bin/solr config -c %s -s %s --action set-user-property --property update.autoCreateFields --value false",
collectionName,
solrUrl);
echo(
Expand Down
7 changes: 4 additions & 3 deletions solr/core/src/java/org/apache/solr/cli/PackageTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,9 @@ public void runImpl(CommandLine cli) throws Exception {
: new String[] {};
packageManager.undeploy(packageName, collections, cli.hasOption("cluster"));
} else {

printRed(
"Either specify -cluster to undeploy cluster level plugins or -collections <list-of-collections> to undeploy collection level plugins");
"Either specify --cluster to undeploy cluster level plugins or -collections <list-of-collections> to undeploy collection level plugins");
}
break;
}
Expand Down Expand Up @@ -259,7 +260,7 @@ public String getHeader() {
format(sb, "");
formatGreen(
sb,
"bin/solr package deploy <package-name>[:<version>] [-y] [--update] -collections <comma-separated-collections> [-p <param1>=<val1> -p <param2>=<val2> ...] ");
"bin/solr package deploy <package-name>[:<version>] [-y] [--update] --collections <comma-separated-collections> [-p <param1>=<val1> -p <param2>=<val2> ...] ");
format(
sb,
"Bootstraps a previously installed package into the specified collections. It the package accepts parameters for its setup commands, they can be specified (as per package documentation).");
Expand All @@ -277,7 +278,7 @@ public String getHeader() {
format(sb, "Print a list of collections on which a given package has been deployed.");
format(sb, "");
formatGreen(
sb, "bin/solr package undeploy <package-name> -collections <comma-separated-collections>");
sb, "bin/solr package undeploy <package-name> --collections <comma-separated-collections>");
format(sb, "Undeploy a package from specified collection(s)");
format(sb, "");
formatGreen(sb, "bin/solr package uninstall <package-name>:<version>");
Expand Down
12 changes: 7 additions & 5 deletions solr/core/src/java/org/apache/solr/core/CoreContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.BytesRef;
import org.apache.solr.api.ClusterPluginsSource;
import org.apache.solr.api.ContainerPluginsRegistry;
import org.apache.solr.api.JerseyResource;
Expand Down Expand Up @@ -239,7 +240,7 @@ public JerseyAppHandlerCache getJerseyAppHandlerCache() {
ExecutorUtil.newMDCAwareCachedThreadPool(
new SolrNamedThreadFactory("coreContainerWorkExecutor"));

private final OrderedExecutor replayUpdatesExecutor;
private final OrderedExecutor<BytesRef> replayUpdatesExecutor;

protected volatile LogWatcher<?> logging = null;

Expand Down Expand Up @@ -420,7 +421,7 @@ public CoreContainer(NodeConfig config, CoresLocator locator, boolean asyncSolrC
this.containerProperties = new Properties(config.getSolrProperties());
this.asyncSolrCoreLoad = asyncSolrCoreLoad;
this.replayUpdatesExecutor =
new OrderedExecutor(
new OrderedExecutor<>(
cfg.getReplayUpdatesThreads(),
ExecutorUtil.newMDCAwareCachedThreadPool(
cfg.getReplayUpdatesThreads(), // thread count
Expand Down Expand Up @@ -727,7 +728,7 @@ public Tracer getTracer() {
return tracer;
}

public OrderedExecutor getReplayUpdatesExecutor() {
public OrderedExecutor<BytesRef> getReplayUpdatesExecutor() {
return replayUpdatesExecutor;
}

Expand Down Expand Up @@ -2057,9 +2058,10 @@ public void reload(String name, UUID coreId) {

DocCollection docCollection = null;
if (getZkController() != null) {
docCollection = getZkController().getClusterState().getCollection(cd.getCollectionName());
docCollection =
getZkController().getClusterState().getCollectionOrNull(cd.getCollectionName());
// turn off indexing now, before the new core is registered
if (docCollection.getBool(ZkStateReader.READ_ONLY, false)) {
if (docCollection != null && docCollection.getBool(ZkStateReader.READ_ONLY, false)) {
newCore.readOnly = true;
}
}
Expand Down
41 changes: 23 additions & 18 deletions solr/core/src/java/org/apache/solr/core/SolrCore.java
Original file line number Diff line number Diff line change
Expand Up @@ -766,29 +766,16 @@ public SolrCore reload(ConfigSet coreConfig) throws IOException {
// only one reload at a time
synchronized (getUpdateHandler().getSolrCoreState().getReloadLock()) {
solrCoreState.increfSolrCoreState();
final SolrCore currentCore;
if (!getNewIndexDir().equals(getIndexDir())) {
// the directory is changing, don't pass on state
currentCore = null;
} else {
currentCore = this;
}

// if directory is changing, then don't pass on state
boolean cloneCoreState = getNewIndexDir().equals(getIndexDir());

boolean success = false;
SolrCore core = null;
try {
CoreDescriptor cd = new CoreDescriptor(name, getCoreDescriptor());
cd.loadExtraProperties(); // Reload the extra properties
core =
new SolrCore(
coreContainer,
cd,
coreConfig,
getDataDir(),
updateHandler,
solrDelPolicy,
currentCore,
true);
core = cloneForReloadCore(cd, coreConfig, cloneCoreState);

// we open a new IndexWriter to pick up the latest config
core.getUpdateHandler().getSolrCoreState().newIndexWriter(core, false);
Expand All @@ -805,6 +792,24 @@ public SolrCore reload(ConfigSet coreConfig) throws IOException {
}
}

/**
* Clones the current core for core reload, with the provided CoreDescriptor and ConfigSet.
*
* @return the cloned core to be used for {@link SolrCore#reload}
*/
protected SolrCore cloneForReloadCore(
CoreDescriptor newCoreDescriptor, ConfigSet newCoreConfig, boolean cloneCoreState) {
return new SolrCore(
coreContainer,
newCoreDescriptor,
newCoreConfig,
getDataDir(),
updateHandler,
solrDelPolicy,
cloneCoreState ? this : null,
true);
}

private DirectoryFactory initDirectoryFactory() {
return DirectoryFactory.loadDirectoryFactory(
solrConfig, coreContainer, coreMetricManager.getRegistryName());
Expand Down Expand Up @@ -1054,7 +1059,7 @@ public CoreContainer getCoreContainer() {
this(coreContainer, cd, configSet, null, null, null, null, false);
}

private SolrCore(
protected SolrCore(
CoreContainer coreContainer,
CoreDescriptor coreDescriptor,
ConfigSet configSet,
Expand Down
Loading

0 comments on commit e918d70

Please sign in to comment.