Skip to content

Commit 9778ed5

Browse files
committed
Merge remote-tracking branch 'upstream/main' into fix_multisearch
2 parents 8ecb0c9 + 20536ee commit 9778ed5

File tree

68 files changed

+1420
-437
lines changed

Some content is hidden

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

68 files changed

+1420
-437
lines changed

.github/workflows/precommit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ${{ matrix.os }}
88
strategy:
99
matrix:
10-
java: [ 11, 17, 21 ]
10+
java: [ 11, 17, 21, 23 ]
1111
os: [ubuntu-latest, windows-latest, macos-latest, macos-13]
1212
steps:
1313
- uses: actions/checkout@v4

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
77
### Added
88
- Add support for async deletion in S3BlobContainer ([#15621](https://github.com/opensearch-project/OpenSearch/pull/15621))
99
- MultiTermQueries in keyword fields now default to `indexed` approach and gated behind cluster setting ([#15637](https://github.com/opensearch-project/OpenSearch/pull/15637))
10+
- [Workload Management] Add Integration Tests for Workload Management CRUD APIs ([#15955](https://github.com/opensearch-project/OpenSearch/pull/15955))
1011
- [Workload Management] QueryGroup resource cancellation framework changes ([#15651](https://github.com/opensearch-project/OpenSearch/pull/15651))
1112
- [Workload Management] Add orchestrator for wlm resiliency (QueryGroupService) ([#15925](https://github.com/opensearch-project/OpenSearch/pull/15925))
13+
- [Workload Management] Add QueryGroup Stats API Logic ([15777](https://github.com/opensearch-project/OpenSearch/pull/15777))
1214
- Fallback to Remote cluster-state on Term-Version check mismatch - ([#15424](https://github.com/opensearch-project/OpenSearch/pull/15424))
1315
- Implement WithFieldName interface in ValuesSourceAggregationBuilder & FieldSortBuilder ([#15916](https://github.com/opensearch-project/OpenSearch/pull/15916))
1416
- Add successfulSearchShardIndices in searchRequestContext ([#15967](https://github.com/opensearch-project/OpenSearch/pull/15967), [#16110](https://github.com/opensearch-project/OpenSearch/pull/16110))
@@ -52,6 +54,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5254
- Remove identity-related feature flagged code from the RestController ([#15430](https://github.com/opensearch-project/OpenSearch/pull/15430))
5355
- Remove Identity FeatureFlag ([#16024](https://github.com/opensearch-project/OpenSearch/pull/16024))
5456
- Ensure RestHandler.Wrapper delegates all implementations to the wrapped handler ([#16154](https://github.com/opensearch-project/OpenSearch/pull/16154))
57+
- Code cleanup: Remove ApproximateIndexOrDocValuesQuery ([#16273](https://github.com/opensearch-project/OpenSearch/pull/16273))
5558

5659

5760
### Deprecated
@@ -65,6 +68,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6568
- Fix search_as_you_type not supporting multi-fields ([#15988](https://github.com/opensearch-project/OpenSearch/pull/15988))
6669
- Avoid infinite loop when `flat_object` field contains invalid token ([#15985](https://github.com/opensearch-project/OpenSearch/pull/15985))
6770
- Fix infinite loop in nested agg ([#15931](https://github.com/opensearch-project/OpenSearch/pull/15931))
71+
- Fix update settings with null replica not honoring cluster setting bug ([#14948](https://github.com/opensearch-project/OpenSearch/pull/14948))
6872
- Fix race condition in node-join and node-left ([#15521](https://github.com/opensearch-project/OpenSearch/pull/15521))
6973
- Streaming bulk request hangs ([#16158](https://github.com/opensearch-project/OpenSearch/pull/16158))
7074
- Fix warnings from SLF4J on startup when repository-s3 is installed ([#16194](https://github.com/opensearch-project/OpenSearch/pull/16194))

buildSrc/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ dependencies {
114114
api 'com.github.johnrengelman:shadow:8.1.1'
115115
api 'org.jdom:jdom2:2.0.6.1'
116116
api "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${props.getProperty('kotlin')}"
117-
api 'de.thetaphi:forbiddenapis:3.6'
117+
api 'de.thetaphi:forbiddenapis:3.8'
118118
api 'com.avast.gradle:gradle-docker-compose-plugin:0.17.6'
119119
api "org.yaml:snakeyaml:${props.getProperty('snakeyaml')}"
120120
api 'org.apache.maven:maven-model:3.9.6'

buildSrc/src/main/java/org/opensearch/gradle/precommit/ThirdPartyAuditPrecommitPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public class ThirdPartyAuditPrecommitPlugin extends PrecommitPlugin {
5151
public TaskProvider<? extends Task> createTask(Project project) {
5252
project.getPlugins().apply(CompileOnlyResolvePlugin.class);
5353
project.getConfigurations().create("forbiddenApisCliJar");
54-
project.getDependencies().add("forbiddenApisCliJar", "de.thetaphi:forbiddenapis:3.5.1");
54+
project.getDependencies().add("forbiddenApisCliJar", "de.thetaphi:forbiddenapis:3.8");
5555

5656
Configuration jdkJarHellConfig = project.getConfigurations().create(JDK_JAR_HELL_CONFIG_NAME);
5757
if (BuildParams.isInternal() && project.getPath().equals(":libs:opensearch-core") == false) {

buildSrc/src/main/java/org/opensearch/gradle/test/DistroTestPlugin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@
7777
import java.util.stream.Stream;
7878

7979
public class DistroTestPlugin implements Plugin<Project> {
80-
private static final String SYSTEM_JDK_VERSION = "21.0.4+7";
80+
private static final String SYSTEM_JDK_VERSION = "23+37";
8181
private static final String SYSTEM_JDK_VENDOR = "adoptium";
82-
private static final String GRADLE_JDK_VERSION = "21.0.4+7";
82+
private static final String GRADLE_JDK_VERSION = "23+37";
8383
private static final String GRADLE_JDK_VENDOR = "adoptium";
8484

8585
// all distributions used by distro tests. this is temporary until tests are per distribution

buildSrc/version.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ opensearch = 3.0.0
22
lucene = 9.12.0
33

44
bundled_jdk_vendor = adoptium
5-
bundled_jdk = 21.0.4+7
5+
bundled_jdk = 23+37
66

77
# optional dependencies
88
spatial4j = 0.7
@@ -60,9 +60,9 @@ bouncycastle=1.78
6060
randomizedrunner = 2.7.1
6161
junit = 4.13.2
6262
hamcrest = 2.1
63-
mockito = 5.12.0
63+
mockito = 5.14.1
6464
objenesis = 3.2
65-
bytebuddy = 1.14.9
65+
bytebuddy = 1.15.4
6666

6767
# benchmark dependencies
6868
jmh = 1.35

gradle/code-coverage.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ repositories {
1919

2020
allprojects {
2121
plugins.withId('jacoco') {
22-
jacoco.toolVersion = '0.8.10'
22+
jacoco.toolVersion = '0.8.12'
2323
}
2424
}
2525

libs/grok/src/main/java/org/opensearch/grok/GrokCaptureConfig.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ public GrokCaptureExtracter forBoolean(Function<Consumer<Boolean>, GrokCaptureEx
114114
/**
115115
* Build an extract that has access to the "native" type of the extracter
116116
* match. This means that patterns like {@code %{NUMBER:bytes:float}} has
117-
* access to an actual {@link float}. Extracters returned from this method
118-
* should be stateless stateless and can be reused. Pathological implementations
117+
* access to an actual float. Extracters returned from this method
118+
* should be stateless and can be reused. Pathological implementations
119119
* of the {@code map} parameter could violate this, but the caller should
120120
* take care to stay sane.
121121
* <p>
@@ -144,27 +144,27 @@ public interface NativeExtracterMap<T> {
144144
T forString(Function<Consumer<String>, GrokCaptureExtracter> buildExtracter);
145145

146146
/**
147-
* Called when the native type is an {@link int}.
147+
* Called when the native type is an int.
148148
*/
149149
T forInt(Function<IntConsumer, GrokCaptureExtracter> buildExtracter);
150150

151151
/**
152-
* Called when the native type is an {@link long}.
152+
* Called when the native type is an long.
153153
*/
154154
T forLong(Function<LongConsumer, GrokCaptureExtracter> buildExtracter);
155155

156156
/**
157-
* Called when the native type is an {@link float}.
157+
* Called when the native type is an float.
158158
*/
159159
T forFloat(Function<FloatConsumer, GrokCaptureExtracter> buildExtracter);
160160

161161
/**
162-
* Called when the native type is an {@link double}.
162+
* Called when the native type is an double.
163163
*/
164164
T forDouble(Function<DoubleConsumer, GrokCaptureExtracter> buildExtracter);
165165

166166
/**
167-
* Called when the native type is an {@link boolean}.
167+
* Called when the native type is an boolean.
168168
*/
169169
T forBoolean(Function<Consumer<Boolean>, GrokCaptureExtracter> buildExtracter);
170170
}

plugins/discovery-ec2/src/test/java/org/opensearch/discovery/ec2/Ec2DiscoveryTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ protected List<TransportAddress> buildDynamicHosts(Settings nodeSettings, int no
175175
exchange.getResponseHeaders().set("Content-Type", "text/xml; charset=UTF-8");
176176
exchange.sendResponseHeaders(HttpStatus.SC_OK, responseBody.length);
177177
exchange.getResponseBody().write(responseBody);
178+
exchange.getResponseBody().flush();
178179
return;
179180
}
180181
}

plugins/discovery-ec2/src/test/java/org/opensearch/discovery/ec2/Ec2RetriesTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ public void testEC2DiscoveryRetriesOnRateLimiting() throws IOException {
125125
exchange.getResponseHeaders().set("Content-Type", "text/xml; charset=UTF-8");
126126
exchange.sendResponseHeaders(HttpStatus.SC_OK, responseBody.length);
127127
exchange.getResponseBody().write(responseBody);
128+
exchange.getResponseBody().flush();
128129
return;
129130
}
130131
}

plugins/repository-hdfs/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,10 @@ for (String fixtureName : ['hdfsFixture', 'haHdfsFixture', 'secureHdfsFixture',
146146
}
147147
final List<String> miniHDFSArgs = []
148148

149+
if (BuildParams.runtimeJavaVersion >= JavaVersion.VERSION_23) {
150+
miniHDFSArgs.add('-Djava.security.manager=allow')
151+
}
152+
149153
// If it's a secure fixture, then depend on Kerberos Fixture and principals + add the krb5conf to the JVM options
150154
if (fixtureName.equals('secureHdfsFixture') || fixtureName.equals('secureHaHdfsFixture')) {
151155
miniHDFSArgs.add("-Djava.security.krb5.conf=${project(':test:fixtures:krb5kdc-fixture').ext.krb5Conf("hdfs")}");

plugins/repository-s3/src/main/java/org/opensearch/repositories/s3/S3RepositoryPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ private static int allocatedProcessors(Settings settings) {
188188
}
189189

190190
private static int urgentPoolCount(Settings settings) {
191-
return boundedBy((allocatedProcessors(settings) + 7) / 8, 1, 2);
191+
return boundedBy((allocatedProcessors(settings) + 1) / 2, 1, 2);
192192
}
193193

194194
private static int priorityPoolCount(Settings settings) {
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*/
8+
9+
package org.opensearch.repositories.s3;
10+
11+
import org.opensearch.common.settings.Settings;
12+
import org.opensearch.common.unit.SizeUnit;
13+
import org.opensearch.common.unit.SizeValue;
14+
import org.opensearch.common.util.concurrent.OpenSearchThreadPoolExecutor;
15+
import org.opensearch.test.OpenSearchTestCase;
16+
import org.opensearch.threadpool.ExecutorBuilder;
17+
import org.opensearch.threadpool.ThreadPool;
18+
import org.opensearch.threadpool.ThreadPool.ThreadPoolType;
19+
20+
import java.io.IOException;
21+
import java.nio.file.Path;
22+
import java.util.List;
23+
import java.util.concurrent.Executor;
24+
25+
import static org.hamcrest.CoreMatchers.instanceOf;
26+
import static org.hamcrest.Matchers.equalTo;
27+
import static org.hamcrest.Matchers.notNullValue;
28+
29+
public class S3RepositoryPluginTests extends OpenSearchTestCase {
30+
31+
private static final String URGENT_FUTURE_COMPLETION = "urgent_future_completion";
32+
33+
public void testGetExecutorBuilders() throws IOException {
34+
final int processors = randomIntBetween(1, 64);
35+
Settings settings = Settings.builder().put("node.name", "test").put("node.processors", processors).build();
36+
Path configPath = createTempDir();
37+
ThreadPool threadPool = null;
38+
try (S3RepositoryPlugin plugin = new S3RepositoryPlugin(settings, configPath)) {
39+
List<ExecutorBuilder<?>> executorBuilders = plugin.getExecutorBuilders(settings);
40+
assertNotNull(executorBuilders);
41+
assertFalse(executorBuilders.isEmpty());
42+
threadPool = new ThreadPool(settings, executorBuilders.toArray(new ExecutorBuilder<?>[0]));
43+
final Executor executor = threadPool.executor(URGENT_FUTURE_COMPLETION);
44+
assertNotNull(executor);
45+
assertThat(executor, instanceOf(OpenSearchThreadPoolExecutor.class));
46+
final OpenSearchThreadPoolExecutor openSearchThreadPoolExecutor = (OpenSearchThreadPoolExecutor) executor;
47+
final ThreadPool.Info info = threadPool.info(URGENT_FUTURE_COMPLETION);
48+
int size = boundedBy((processors + 1) / 2, 1, 2);
49+
assertThat(info.getName(), equalTo(URGENT_FUTURE_COMPLETION));
50+
assertThat(info.getThreadPoolType(), equalTo(ThreadPoolType.FIXED));
51+
assertThat(info.getQueueSize(), notNullValue());
52+
assertThat(info.getQueueSize(), equalTo(new SizeValue(10, SizeUnit.KILO)));
53+
assertThat(openSearchThreadPoolExecutor.getQueue().remainingCapacity(), equalTo(10_000));
54+
55+
assertThat(info.getMin(), equalTo(size));
56+
assertThat(openSearchThreadPoolExecutor.getCorePoolSize(), equalTo(size));
57+
assertThat(info.getMax(), equalTo(size));
58+
assertThat(openSearchThreadPoolExecutor.getMaximumPoolSize(), equalTo(size));
59+
60+
final int availableProcessors = Runtime.getRuntime().availableProcessors();
61+
if (processors > availableProcessors) {
62+
assertWarnings(
63+
"setting [node.processors] to value ["
64+
+ processors
65+
+ "] which is more than available processors ["
66+
+ availableProcessors
67+
+ "] is deprecated"
68+
);
69+
}
70+
} finally {
71+
if (threadPool != null) {
72+
terminate(threadPool);
73+
}
74+
}
75+
}
76+
77+
private static int boundedBy(int value, int min, int max) {
78+
return Math.min(max, Math.max(min, value));
79+
}
80+
81+
}

plugins/workload-management/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
*/
1111

1212
apply plugin: 'opensearch.yaml-rest-test'
13+
apply plugin: 'opensearch.java-rest-test'
1314
apply plugin: 'opensearch.internal-cluster-test'
1415

1516
opensearchplugin {

0 commit comments

Comments
 (0)