Skip to content

Commit e918d70

Browse files
authored
Merge branch 'apache:main' into feature/SOLR-17334
2 parents 1332b32 + 8ddc3be commit e918d70

File tree

162 files changed

+1815
-1423
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

162 files changed

+1815
-1423
lines changed

.asf.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ github:
2828
branch_9_4: {}
2929
branch_9_5: {}
3030
branch_9_6: {}
31+
branch_9_7: {}
3132
branch_9x: {}
3233

3334
protected_tags:

.github/workflows/bin-solr-test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010
- 'solr/bin/**'
1111
- 'solr/packaging/**'
1212
- 'solr/core/src/java/org/apache/solr/cli/**'
13+
- 'solr/prometheus-exporter/**'
1314

1415
jobs:
1516
test:
@@ -47,4 +48,3 @@ jobs:
4748
with:
4849
name: logs
4950
path: solr/packaging/build/test-output
50-

.github/workflows/gradle-precommit.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ jobs:
4141
- name: Run gradle check (without tests)
4242
run: ./gradlew check -x test -Ptask.times=true
4343

44-
- uses: gradle/wrapper-validation-action@v2
44+
- uses: gradle/wrapper-validation-action@v3

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
Solr is the popular, blazing fast open source search platform for all your
2222
enterprise, e-commerce, and analytics needs, built on [Apache Lucene](https://lucene.apache.org/).
2323

24+
[![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/)
25+
[![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/)
26+
2427
For a complete description of the Solr project, team composition, source
2528
code repositories, and other details, please see the Solr web site at
2629
https://solr.apache.org/

dev-tools/scripts/releaseWizard.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1123,7 +1123,7 @@ def file_to_string(filename):
11231123
return f.read().strip()
11241124

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

11281128
def keys_downloaded():
11291129
return os.path.exists(os.path.join(state.config_path, "KEYS"))

dev-tools/scripts/releaseWizard.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ groups:
689689
{% if release_type == 'major' -%}
690690
. Change name of version `main ({{ release_version_major }}.0)` into `{{ release_version_major }}.0`
691691
{%- endif %}
692-
. Create a new (unreleased) version `{{ get_next_version }}`
692+
. Create a new (unreleased) version `{{ release_version_major }}.{{ release_version_minor + 1 }}`
693693
types:
694694
- major
695695
- minor

solr/CHANGES.txt

+57-10
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,45 @@ Other Changes
100100

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

103+
================== 9.8.0 ==================
104+
New Features
105+
---------------------
106+
(No changes)
107+
108+
Improvements
109+
---------------------
110+
* SOLR-17397: SkipExistingDocumentsProcessor now functions correctly with child documents. (Tim Owens via Eric Pugh)
111+
112+
Optimizations
113+
---------------------
114+
* SOLR-14985: Solrj CloudSolrClient with Solr URLs had serious performance regressions (since the
115+
beginning?) in which its collection state cache was not being used, resulting in many extra
116+
requests to Solr for cluster information. (Aparna Suresh, shalin, David Smiley)
117+
118+
* SOLR-17102: The VersionBucket indexing lock mechanism was replaced with something just as fast yet
119+
that which consumes almost no memory, saving 1MB of memory per SolrCore. (David Smiley)
120+
121+
* SOLR-17381: Make CLUSTERSTATUS request configurable to improve performance by allowing retrieval of specific information,
122+
reducing unnecessary data fetching. (Aparna Suresh, David Smiley)
123+
124+
* SOLR-17396: Reduce thread contention in ZkStateReader.getCollectionProperties(). (Aparna Suresh, David Smiley, Paul McArthur)
125+
126+
Bug Fixes
127+
---------------------
128+
(No changes)
129+
130+
Dependency Upgrades
131+
---------------------
132+
(No changes)
133+
134+
Other Changes
135+
---------------------
136+
(No changes)
137+
103138
================== 9.7.0 ==================
104139
New Features
105140
---------------------
106-
* SOLR-13350: Multithreaded search execution (Ishan Chattopadhyaya, Mark Miller, Christine Poerschke, David Smiley, noble)
141+
* SOLR-13350, SOLR-17298: Opt-in multithreaded search execution (Ishan Chattopadhyaya, Mark Miller, Christine Poerschke, David Smiley, noble, Gus Heck)
107142

108143
* SOLR-17192: Put an UpdateRequestProcessor-enforced soft-limit on the number of fields allowed in a core. The `NumFieldLimitingUpdateRequestProcessorFactory`
109144
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
@@ -124,8 +159,18 @@ New Features
124159

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

162+
* SOLR-17276: Prometheus Exporter: now scrapes metrics at a fixed rate instead of delay. (Rafał Harabień)
163+
127164
Improvements
128165
---------------------
166+
* SOLR-10808, SOLR-12963: The Solr schema version has been increased to 1.7.
167+
Starting in schema version 1.7, most fields/fieldTypes that support docValues will have them enabled by default.
168+
These field types include primitive (Numeric, Date, Bool, String, Enum, UUID), sorting (SortableTextField, SortableBinaryField, CollationField, ICUCollationField) and LatLonPointSpacialField.
169+
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.
170+
Also in schema version 1.7, all fields/fieldTypes will be unable to be uninverted by default.
171+
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.
172+
(Houston Putman, hossman)
173+
129174
* SOLR-17137: Enable Prometheus exporter to communicate with SSL protected Solr. (Eivind Bergstøl via Eric Pugh)
130175

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

147192
* 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
148193
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
149-
commands "same user" check which has -u as the short form of --same-user. (Eric Pugh, janhoy, Jason Gerlowski)
194+
commands "same user" check which has -u as the short form of --same-user. (Eric Pugh, janhoy, Jason Gerlowski, Christos Malliaridis)
150195

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

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

159-
* SOLR-10808, SOLR-12963: The Solr schema version has been increased to 1.7.
160-
Starting in schema version 1.7, all fields/fieldTypes that support docValues will have them enabled by default.
161-
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.
162-
Also in schema version 1.7, all fields/fieldTypes will be unable to be uninverted by default.
163-
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.
164-
(Houston Putman, hossman)
165-
166204
* SOLR-10808 : The Solr schema version has been increased to 1.7. Since schema version 1.7, all fields/fieldTypes that
167205
support docValues will have them enabled by default. This behavior can be reverted by setting
168206
'docValues' parameter for a field or a field type to false, the default for schema versions 1.6 and below. (Houston Putman)
@@ -174,7 +212,7 @@ Optimizations
174212

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

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

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

@@ -221,6 +259,12 @@ Bug Fixes
221259

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

262+
* SOLR-17394: Detect and handle non-200 HTTP status codes for requests made by IndexFetcher (Jason Gerlowski)
263+
264+
* SOLR-17391: Fixed performance regression of misconfigured threadpools from SOLR-16879 (Solr 9.4).
265+
Shard splits and concurrent/large collection backup/restore performance was serial. UpdateLog
266+
replay was a little suboptimal in thread usage too. (Pierre Salagnac, Hakan Özler, David Smiley)
267+
224268
Dependency Upgrades
225269
---------------------
226270
(No changes)
@@ -252,6 +296,9 @@ Other Changes
252296
* SOLR-17322: Once again allow rank queries to use custom TopDocsCollectors that operate on types that extend
253297
ScoreDocs (covariant generic types) broken in Solr 9.0. (Stephen Woods via Christine Poerschke)
254298

299+
* SOLR-16996: Update Solr Exporter for Prometheus cli to use commons-cli instead of argparse4j. (Christos Malliaridis via Eric Pugh)
300+
301+
255302
================== 9.6.1 ==================
256303
Bug Fixes
257304
---------------------

solr/bin/solr.cmd

+4-4
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ set FIRST_ARG=%1
246246

247247
IF [%1]==[] goto usage
248248

249+
REM -help is a special case to faciliate folks learning about how to use Solr.
249250
IF "%1"=="-help" goto run_solrcli
250251
IF "%1"=="-usage" goto run_solrcli
251252
IF "%1"=="-h" goto run_solrcli
@@ -293,7 +294,6 @@ IF "%FIRST_ARG%"=="-help" goto run_solrcli
293294
IF "%FIRST_ARG%"=="-usage" goto run_solrcli
294295
IF "%FIRST_ARG%"=="-h" goto run_solrcli
295296
IF "%FIRST_ARG%"=="--help" goto run_solrcli
296-
IF "%FIRST_ARG%"=="-help" goto run_solrcli
297297
IF "%FIRST_ARG%"=="/?" goto run_solrcli
298298
IF "%SCRIPT_CMD%"=="start" goto start_usage
299299
IF "%SCRIPT_CMD%"=="restart" goto start_usage
@@ -316,7 +316,7 @@ goto done
316316
@echo -f Start Solr in foreground; default starts Solr in the background
317317
@echo and sends stdout / stderr to solr-PORT-console.log
318318
@echo.
319-
@echo -c or -cloud Start Solr in SolrCloud mode; if -z not supplied and ZK_HOST not defined in
319+
@echo -c or --cloud Start Solr in SolrCloud mode; if -z not supplied and ZK_HOST not defined in
320320
@echo solr.in.cmd, an embedded ZooKeeper instance is started on Solr port+1000,
321321
@echo such as 9983 if Solr is bound to 8983
322322
@echo.
@@ -1493,10 +1493,10 @@ IF "!ZK_OP!"=="" (
14931493
set CONNECTION_PARAMS=""
14941494

14951495
IF "!ZK_OP!"=="" (
1496-
set CONNECTION_PARAMS="-solrUrl !ZK_SOLR_URL!"
1496+
set CONNECTION_PARAMS="--solr-url !ZK_SOLR_URL!"
14971497
)
14981498
ELSE (
1499-
set CONNECTION_PARAMS="-zkHost ZK_HOST!"
1499+
set CONNECTION_PARAMS="--zk-host ZK_HOST!"
15001500
)
15011501

15021502
IF "!ZK_OP!"=="upconfig" (

solr/core/src/java/org/apache/solr/cli/CreateTool.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ private void printDefaultConfigsetWarningIfNecessary(CommandLine cli) {
411411
final String configCommand =
412412
String.format(
413413
Locale.ROOT,
414-
"bin/solr config -c %s -solrUrl %s -action set-user-property -property update.autoCreateFields -value false",
414+
"bin/solr config -c %s -s %s --action set-user-property --property update.autoCreateFields --value false",
415415
collectionName,
416416
solrUrl);
417417
echo(

solr/core/src/java/org/apache/solr/cli/PackageTool.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,9 @@ public void runImpl(CommandLine cli) throws Exception {
205205
: new String[] {};
206206
packageManager.undeploy(packageName, collections, cli.hasOption("cluster"));
207207
} else {
208+
208209
printRed(
209-
"Either specify -cluster to undeploy cluster level plugins or -collections <list-of-collections> to undeploy collection level plugins");
210+
"Either specify --cluster to undeploy cluster level plugins or -collections <list-of-collections> to undeploy collection level plugins");
210211
}
211212
break;
212213
}
@@ -259,7 +260,7 @@ public String getHeader() {
259260
format(sb, "");
260261
formatGreen(
261262
sb,
262-
"bin/solr package deploy <package-name>[:<version>] [-y] [--update] -collections <comma-separated-collections> [-p <param1>=<val1> -p <param2>=<val2> ...] ");
263+
"bin/solr package deploy <package-name>[:<version>] [-y] [--update] --collections <comma-separated-collections> [-p <param1>=<val1> -p <param2>=<val2> ...] ");
263264
format(
264265
sb,
265266
"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).");
@@ -277,7 +278,7 @@ public String getHeader() {
277278
format(sb, "Print a list of collections on which a given package has been deployed.");
278279
format(sb, "");
279280
formatGreen(
280-
sb, "bin/solr package undeploy <package-name> -collections <comma-separated-collections>");
281+
sb, "bin/solr package undeploy <package-name> --collections <comma-separated-collections>");
281282
format(sb, "Undeploy a package from specified collection(s)");
282283
format(sb, "");
283284
formatGreen(sb, "bin/solr package uninstall <package-name>:<version>");

solr/core/src/java/org/apache/solr/core/CoreContainer.java

+7-5
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
import org.apache.lucene.index.IndexWriter;
6464
import org.apache.lucene.search.IndexSearcher;
6565
import org.apache.lucene.store.Directory;
66+
import org.apache.lucene.util.BytesRef;
6667
import org.apache.solr.api.ClusterPluginsSource;
6768
import org.apache.solr.api.ContainerPluginsRegistry;
6869
import org.apache.solr.api.JerseyResource;
@@ -239,7 +240,7 @@ public JerseyAppHandlerCache getJerseyAppHandlerCache() {
239240
ExecutorUtil.newMDCAwareCachedThreadPool(
240241
new SolrNamedThreadFactory("coreContainerWorkExecutor"));
241242

242-
private final OrderedExecutor replayUpdatesExecutor;
243+
private final OrderedExecutor<BytesRef> replayUpdatesExecutor;
243244

244245
protected volatile LogWatcher<?> logging = null;
245246

@@ -420,7 +421,7 @@ public CoreContainer(NodeConfig config, CoresLocator locator, boolean asyncSolrC
420421
this.containerProperties = new Properties(config.getSolrProperties());
421422
this.asyncSolrCoreLoad = asyncSolrCoreLoad;
422423
this.replayUpdatesExecutor =
423-
new OrderedExecutor(
424+
new OrderedExecutor<>(
424425
cfg.getReplayUpdatesThreads(),
425426
ExecutorUtil.newMDCAwareCachedThreadPool(
426427
cfg.getReplayUpdatesThreads(), // thread count
@@ -727,7 +728,7 @@ public Tracer getTracer() {
727728
return tracer;
728729
}
729730

730-
public OrderedExecutor getReplayUpdatesExecutor() {
731+
public OrderedExecutor<BytesRef> getReplayUpdatesExecutor() {
731732
return replayUpdatesExecutor;
732733
}
733734

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

20582059
DocCollection docCollection = null;
20592060
if (getZkController() != null) {
2060-
docCollection = getZkController().getClusterState().getCollection(cd.getCollectionName());
2061+
docCollection =
2062+
getZkController().getClusterState().getCollectionOrNull(cd.getCollectionName());
20612063
// turn off indexing now, before the new core is registered
2062-
if (docCollection.getBool(ZkStateReader.READ_ONLY, false)) {
2064+
if (docCollection != null && docCollection.getBool(ZkStateReader.READ_ONLY, false)) {
20632065
newCore.readOnly = true;
20642066
}
20652067
}

solr/core/src/java/org/apache/solr/core/SolrCore.java

+23-18
Original file line numberDiff line numberDiff line change
@@ -766,29 +766,16 @@ public SolrCore reload(ConfigSet coreConfig) throws IOException {
766766
// only one reload at a time
767767
synchronized (getUpdateHandler().getSolrCoreState().getReloadLock()) {
768768
solrCoreState.increfSolrCoreState();
769-
final SolrCore currentCore;
770-
if (!getNewIndexDir().equals(getIndexDir())) {
771-
// the directory is changing, don't pass on state
772-
currentCore = null;
773-
} else {
774-
currentCore = this;
775-
}
769+
770+
// if directory is changing, then don't pass on state
771+
boolean cloneCoreState = getNewIndexDir().equals(getIndexDir());
776772

777773
boolean success = false;
778774
SolrCore core = null;
779775
try {
780776
CoreDescriptor cd = new CoreDescriptor(name, getCoreDescriptor());
781777
cd.loadExtraProperties(); // Reload the extra properties
782-
core =
783-
new SolrCore(
784-
coreContainer,
785-
cd,
786-
coreConfig,
787-
getDataDir(),
788-
updateHandler,
789-
solrDelPolicy,
790-
currentCore,
791-
true);
778+
core = cloneForReloadCore(cd, coreConfig, cloneCoreState);
792779

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

795+
/**
796+
* Clones the current core for core reload, with the provided CoreDescriptor and ConfigSet.
797+
*
798+
* @return the cloned core to be used for {@link SolrCore#reload}
799+
*/
800+
protected SolrCore cloneForReloadCore(
801+
CoreDescriptor newCoreDescriptor, ConfigSet newCoreConfig, boolean cloneCoreState) {
802+
return new SolrCore(
803+
coreContainer,
804+
newCoreDescriptor,
805+
newCoreConfig,
806+
getDataDir(),
807+
updateHandler,
808+
solrDelPolicy,
809+
cloneCoreState ? this : null,
810+
true);
811+
}
812+
808813
private DirectoryFactory initDirectoryFactory() {
809814
return DirectoryFactory.loadDirectoryFactory(
810815
solrConfig, coreContainer, coreMetricManager.getRegistryName());
@@ -1054,7 +1059,7 @@ public CoreContainer getCoreContainer() {
10541059
this(coreContainer, cd, configSet, null, null, null, null, false);
10551060
}
10561061

1057-
private SolrCore(
1062+
protected SolrCore(
10581063
CoreContainer coreContainer,
10591064
CoreDescriptor coreDescriptor,
10601065
ConfigSet configSet,

0 commit comments

Comments
 (0)