Skip to content

Commit

Permalink
Merge branch 'main' into curator
Browse files Browse the repository at this point in the history
  • Loading branch information
risdenk committed Oct 24, 2023
2 parents 28759c9 + d31b55a commit a12176b
Show file tree
Hide file tree
Showing 298 changed files with 2,528 additions and 1,512 deletions.
16 changes: 8 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ import java.time.ZonedDateTime
import java.time.format.DateTimeFormatter

plugins {
id "base"
id "com.palantir.consistent-versions" version "2.16.0"
id "org.owasp.dependencycheck" version "8.0.1"
id 'ca.cutterslade.analyze' version "1.9.0"
id 'base'
id 'com.palantir.consistent-versions' version '2.16.0'
id 'org.owasp.dependencycheck' version '8.4.0'
id 'ca.cutterslade.analyze' version '1.9.1'
id 'de.thetaphi.forbiddenapis' version '3.6' apply false
id "de.undercouch.download" version "5.2.0" apply false
id "net.ltgt.errorprone" version "3.0.1" apply false
id 'com.diffplug.spotless' version "6.5.2" apply false
id 'com.github.node-gradle.node' version '3.4.0' apply false
id 'de.undercouch.download' version '5.5.0' apply false
id 'net.ltgt.errorprone' version '3.1.0' apply false
id 'com.diffplug.spotless' version '6.5.2' apply false
id 'com.github.node-gradle.node' version '7.0.1' apply false
}

apply from: file('gradle/globals.gradle')
Expand Down
10 changes: 5 additions & 5 deletions buildSrc/scriptDepVersions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@

ext {
scriptDepVersions = [
"apache-rat": "0.14",
"commons-codec": "1.15",
"ecj": "3.30.0",
"apache-rat": "0.15",
"commons-codec": "1.16.0",
"ecj": "3.33.0",
"javacc": "7.0.12",
"jgit": "5.13.1.202206130422-r",
"flexmark": "0.64.0",
"jgit": "6.7.0.202309050840-r",
"flexmark": "0.64.8",
]
}
7 changes: 7 additions & 0 deletions dev-tools/doap/solr.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@
</maintainer>

<!-- NOTE: please insert releases in numeric order, NOT chronologically. -->
<release>
<Version>
<name>solr-9.4.0</name>
<created>2023-10-14</created>
<revision>9.4.0</revision>
</Version>
</release>
<release>
<Version>
<name>solr-9.3.0</name>
Expand Down
4 changes: 2 additions & 2 deletions dev-tools/scripts/addVersion.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def edit(buffer, match, line):
print('done' if changed else 'uptodate')

def update_solrversion_class(new_version):
filename = 'solr/core/src/java/org/apache/solr/util/SolrVersion.java'
filename = 'solr/api/src/java/org/apache/solr/client/api/util/SolrVersion.java'
print(' changing version to %s...' % new_version.dot, end='', flush=True)
constant_prefix = 'public static final String LATEST_STRING = "(.*?)"'
matcher = re.compile(constant_prefix)
Expand Down Expand Up @@ -104,7 +104,7 @@ def edit(buffer, match, line):

def check_solr_version_class_tests():
print(' checking solr version tests...', end='', flush=True)
run('./gradlew -p solr/core test --tests TestSolrVersion')
run('./gradlew -p solr/api test --tests TestSolrVersion')
print('ok')

def check_lucene_match_version_tests():
Expand Down
11 changes: 6 additions & 5 deletions dev-tools/scripts/releaseWizard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ groups:
title: Prerequisites
description: |
Releasing software requires thorough understanding of the process and careful execution,
as it is easy to make mistakes. It also requires an environtment and tools such as gpg
as it is easy to make mistakes. It also requires an environment and tools such as gpg
correctly setup. This section makes sure you're in good shape for the job!
todos:
- !Todo
Expand Down Expand Up @@ -526,7 +526,7 @@ groups:
- major
- minor
links:
- https://cwiki.apache.org/confluence/display/LUCENEJAVA/JenkinsReleaseBuilds
- https://cwiki.apache.org/confluence/display/SOLR/JenkinsReleaseBuilds+-+Solr
- !Todo
id: inform_devs
title: Inform Devs of the new Release Branch
Expand All @@ -544,7 +544,7 @@ groups:
NOTICE:
Branch {{ release_branch }} has been cut and versions updated to {{ release_version_major }}.{{ release_version_minor + 1 }} on stable branch.
Branch {{ release_branch }} has been cut and versions updated to {{ release_version_major }}.{{ release_version_minor + 1 }} on the stable branch.
Please observe the normal rules:
Expand Down Expand Up @@ -636,7 +636,7 @@ groups:
Ask on dev@ for input. Ideally the timing of this request mostly coincides with the
release branch creation. It's a good idea to remind the devs of this later in the release too.
NOTE: Do not add every single JIRA issue, but distill the Release note into important changes!
NOTE: Do not add every single JIRA issue, but distill the release notes into important changes!
links:
- https://cwiki.apache.org/confluence/display/SOLR/Release+Notes
- !Todo
Expand All @@ -660,7 +660,7 @@ groups:
description: |-
To make sure a new release is not announced before the reference guide is complete, add a new
Blocker JIRA issue for version {{ release_version }} with subject
"Complete Major changes and Upgrade Notes in RefGudie for {{ release_version }}".
"Complete Major changes and Upgrade Notes in RefGuide for {{ release_version }}".
Note that this does not block the RC and voting process, but will block announcing the release.
types:
- major
Expand Down Expand Up @@ -1588,6 +1588,7 @@ groups:
Fill in the same date that you used for the release in previous steps.
Do not use a product name prefix for the version, as this is the main release of the Solr PMC.
Just use the version of this release: {{ release_version }}
Note: you have to be a member of the Solr PMC to be able to complete this step.
links:
- https://reporter.apache.org/addrelease.html?solr
- !TodoGroup
Expand Down
5 changes: 5 additions & 0 deletions gradle/validation/error-prone.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ allprojects { prj ->
// '-Xep:DoNotMockAutoValue:OFF', // we don't use autovalue
// '-Xep:DoNotUseRuleChain:OFF', // todo could be fixed but not easy
// '-Xep:DoubleCheckedLocking:OFF', // todo check if useful or comment why not
'-Xep:DuplicateDateFormatField:WARN',
'-Xep:EmptyBlockTag:WARN',
// '-Xep:EmptyCatch:OFF', // todo check if useful or comment why not - might be handled by ECJ?
// '-Xep:EmptySetMultibindingContributions:OFF', // we don't use this annotation
Expand Down Expand Up @@ -420,6 +421,7 @@ allprojects { prj ->
// '-Xep:NonAtomicVolatileUpdate:OFF', // todo check if useful or comment why not
'-Xep:NonCanonicalType:WARN',
'-Xep:NonOverridingEquals:WARN',
//'-Xep:NonFinalStaticField:WARN', // todo there are problems that should be fixed
'-Xep:NotJavadoc:WARN',
'-Xep:NullOptional:WARN',
// '-Xep:NullableConstructor:OFF', // we don't use this annotation
Expand Down Expand Up @@ -464,7 +466,10 @@ allprojects { prj ->
// '-Xep:StreamResourceLeak:OFF', // todo check if useful or comment why not
'-Xep:StreamToIterable:WARN',
// '-Xep:StringCaseLocaleUsage:OFF', // we have forbiddenapis for that
'-Xep:StringCharset:WARN',
'-Xep:StringFormatWithLiteral:WARN',
// '-Xep:StringSplitter:OFF', // todo check if useful or comment why not - might be able to use forbidden-apis for this?
'-Xep:SuperEqualsIsObjectEquals:WARN',
// '-Xep:SwigMemoryLeak:OFF', // we don't use swig
// '-Xep:SynchronizeOnNonFinalField:OFF', // todo check if useful or comment why not
// '-Xep:ThreadJoinLoop:OFF', // todo check if useful or comment why not
Expand Down
22 changes: 15 additions & 7 deletions solr/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ https://github.com/apache/solr/blob/main/solr/solr-ref-guide/modules/upgrade-not

New Features
---------------------
(No changes)

* SOLR-16943: Extend Solr client tracing coverage to both Jetty Client and Apache HttpClient (Alex Deparvu, David Smiley)

Improvements
---------------------
Expand All @@ -25,7 +26,7 @@ Optimizations

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


Deprecation Removals
----------------------
Expand All @@ -42,6 +43,8 @@ Deprecation Removals

* SOLR-16893: Remove bin/solr create_core and create_collection commands in favour of bin/solr create command. (Eric Pugh)

* SOLR-17042: Remove deprecated `V2RequestSupport` and associated `SolrRequest` methods `setUseV2` and `setUseBinaryV2`. (Jason Gerlowski)

Dependency Upgrades
---------------------
(No changes)
Expand All @@ -65,25 +68,30 @@ Other Changes

* SOLR-16911: Establish /solr as the only host context supported by Solr, removing legacy ability to change this. Solr paths will only be either /solr or /api now. (Eric Pugh)

* SOLR-16995: Add a ReplicaCount class to keep track of replicas per type (Vincent Primault)

================== 9.5.0 ==================
New Features
---------------------
(No changes)
* SOLR-14496: Solr CLI commands now can interact with a Solr secured using Basic Authentication. (Eric Pugh)

* SOLR-17006: Collection creation & adding replicas: User-defined properties are persisted to state.json and
applied to new replicas, available for use as property substitution in configuration files. (Vincent Primault)

Improvements
---------------------
* SOLR-16924: RESTORECORE now sets the UpdateLog to ACTIVE state instead of requiring a separate
REQUESTAPPLYUPDATES call in Collection restore. (Julia Lamoine, David Smiley)

* SOLR-17019: ZkCli should create chroot when necessary (Houston Putman)

Optimizations
---------------------
(No changes)

Bug Fixes
---------------------
(No changes)
* SOLR-6853: Allow '/' characters in the text managed by Managed Resources API. (Nikita Rusetskii via Eric Pugh)

* SOLR-17039: Entropy calculation in bin/solr script fails in Docker due to missing 'bc' cmd (janhoy)

Dependency Upgrades
---------------------
Expand All @@ -93,7 +101,7 @@ Dependency Upgrades

Other Changes
---------------------
(No changes)
* SOLR-17024: Remove support for the long-defunct "collectionDefaults" clusterprops key (Jason Gerlowski)

================== 9.4.0 ==================
New Features
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,9 @@
@State(Scope.Benchmark)
public class BaseBenchState {

private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
private static final long RANDOM_SEED = System.nanoTime();

private static final long RANDOM_SEED = 6624420638116043983L;

private static final SplittableRandom random = new SplittableRandom(getInitRandomeSeed());
private static final SplittableRandom random = new SplittableRandom(getInitRandomSeed());

/**
* Gets random seed.
Expand Down Expand Up @@ -137,13 +135,14 @@ public static void dumpHeap(BenchmarkParams benchmarkParams) throws IOException
}
}

private static Long getInitRandomeSeed() {
private static Long getInitRandomSeed() {
Long seed = Long.getLong("solr.bench.seed");

if (seed == null) {
seed = RANDOM_SEED;
}

log("");
log("benchmark random seed: " + seed);

return seed;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.solr.bench;

import java.util.Collection;
import java.util.Iterator;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicInteger;

public class CircularIterator<T> implements Iterator<T> {

private final Object[] collection;
private final AtomicInteger idx;

public CircularIterator(Collection<T> collection) {
this.collection = Objects.requireNonNull(collection).toArray();
if (this.collection.length == 0) {
throw new IllegalArgumentException("This iterator doesn't support empty collections");
}
this.idx = new AtomicInteger();
}

@Override
public boolean hasNext() {
return true;
}

@SuppressWarnings("unchecked")
@Override
public T next() {
return (T) collection[idx.incrementAndGet() % collection.length];
}

public int cycles() {
return ((idx.get() - 1) / collection.length) + 1;
}
}
27 changes: 12 additions & 15 deletions solr/benchmark/src/java/org/apache/solr/bench/Docs.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import static org.apache.solr.bench.BaseBenchState.log;

import java.lang.invoke.MethodHandles;
import java.util.Collections;
import java.util.Date;
import java.util.Iterator;
Expand All @@ -38,8 +37,6 @@
import org.apache.solr.common.util.SuppressForbidden;
import org.quicktheories.core.Gen;
import org.quicktheories.impl.BenchmarkRandomSource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* A tool to generate controlled random data for a benchmark. {@link SolrInputDocument}s are created
Expand All @@ -50,8 +47,6 @@
* them via {@link #generatedDocsIterator}.
*/
public class Docs {
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());

private final ThreadLocal<SolrRandomnessSource> random;
private final Queue<SolrInputDocument> docs = new ConcurrentLinkedQueue<>();

Expand Down Expand Up @@ -104,7 +99,7 @@ private Docs(Long seed) {
*/
@SuppressForbidden(reason = "This module does not need to deal with logging context")
public Iterator<SolrInputDocument> preGenerate(int numDocs) throws InterruptedException {
log("preGenerate docs " + numDocs + " ...");
log("preGenerate docs=" + numDocs + " ...");
docs.clear();
executorService =
Executors.newFixedThreadPool(
Expand All @@ -114,14 +109,7 @@ public Iterator<SolrInputDocument> preGenerate(int numDocs) throws InterruptedEx
for (int i = 0; i < numDocs; i++) {
executorService.submit(
() -> {
try {
SolrInputDocument doc = Docs.this.inputDocument();
docs.add(doc);
} catch (Exception e) {
log.error("error adding doc", e);
executorService.shutdownNow();
throw new RuntimeException(e);
}
docs.add(Docs.this.inputDocument());
});
}

Expand All @@ -144,14 +132,23 @@ public Iterator<SolrInputDocument> preGenerate(int numDocs) throws InterruptedEx
}

/**
* Generated docs iterator iterator.
* Generated docs iterator.
*
* @return the iterator
*/
public Iterator<SolrInputDocument> generatedDocsIterator() {
return docs.iterator();
}

/**
* Generated docs circular iterator.
*
* @return the iterator that never ends
*/
public CircularIterator<SolrInputDocument> generatedDocsCircularIterator() {
return new CircularIterator<>(docs);
}

/**
* Input document solr input document.
*
Expand Down
Loading

0 comments on commit a12176b

Please sign in to comment.