Skip to content

Commit 27ccc9c

Browse files
authored
Merge branch 'main' into fix-remove-skip-tags-for-version-7.x
Signed-off-by: Sriram Ganesh <srignsh22@gmail.com>
2 parents 8068dae + 471acef commit 27ccc9c

File tree

467 files changed

+21469
-6313
lines changed

Some content is hidden

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

467 files changed

+21469
-6313
lines changed

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,40 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1616
- Add FilterFieldType for developers who want to wrap MappedFieldType ([#17627](https://github.com/opensearch-project/OpenSearch/pull/17627))
1717
- [Rule Based Auto-tagging] Add in-memory rule processing service ([#17365](https://github.com/opensearch-project/OpenSearch/pull/17365))
1818
- [Security Manager Replacement] Create initial Java Agent to intercept Socket::connect calls ([#17724](https://github.com/opensearch-project/OpenSearch/pull/17724))
19+
- Faster `terms_query` with already sorted terms ([#17714](https://github.com/opensearch-project/OpenSearch/pull/17714))
1920
- Add ingestion management APIs for pause, resume and get ingestion state ([#17631](https://github.com/opensearch-project/OpenSearch/pull/17631))
2021
- [Security Manager Replacement] Enhance Java Agent to intercept System::exit ([#17746](https://github.com/opensearch-project/OpenSearch/pull/17746))
2122
- [Security Manager Replacement] Add a policy parser for Java agent security policies ([#17753](https://github.com/opensearch-project/OpenSearch/pull/17753))
2223
- [Security Manager Replacement] Implement File Interceptor and add integration tests ([#17760](https://github.com/opensearch-project/OpenSearch/pull/17760))
2324
- [Security Manager Replacement] Enhance Java Agent to intercept Runtime::halt ([#17757](https://github.com/opensearch-project/OpenSearch/pull/17757))
25+
- [Security Manager Replacement] Phase off SecurityManager usage in favor of Java Agent ([#17861](https://github.com/opensearch-project/OpenSearch/pull/17861))
2426
- Support AutoExpand for SearchReplica ([#17741](https://github.com/opensearch-project/OpenSearch/pull/17741))
27+
- Add TLS enabled SecureNetty4GrpcServerTransport ([#17796](https://github.com/opensearch-project/OpenSearch/pull/17796))
2528
- Implement fixed interval refresh task scheduling ([#17777](https://github.com/opensearch-project/OpenSearch/pull/17777))
29+
- [Tiered caching] Create a single cache manager for all the disk caches. ([#17513](https://github.com/opensearch-project/OpenSearch/pull/17513))
2630
- Add GRPC DocumentService and Bulk endpoint ([#17727](https://github.com/opensearch-project/OpenSearch/pull/17727))
2731
- Added scale to zero (`search_only` mode) support for OpenSearch reader writer separation ([#17299](https://github.com/opensearch-project/OpenSearch/pull/17299)
2832
- [Star Tree] [Search] Resolving numeric range aggregation with metric aggregation using star-tree ([#17273](https://github.com/opensearch-project/OpenSearch/pull/17273))
2933
- Added Search Only strict routing setting ([#17803](https://github.com/opensearch-project/OpenSearch/pull/17803))
3034
- Disable the index API for ingestion engine ([#17768](https://github.com/opensearch-project/OpenSearch/pull/17768))
35+
- Add SearchService and Search GRPC endpoint ([#17830](https://github.com/opensearch-project/OpenSearch/pull/17830))
36+
- Add update and delete support in pull-based ingestion ([#17822](https://github.com/opensearch-project/OpenSearch/pull/17822))
37+
- Allow maxPollSize and pollTimeout in IngestionSource to be configurable ([#17863](https://github.com/opensearch-project/OpenSearch/pull/17863))
38+
- [Star Tree] [Search] Add query changes to support unsigned-long in star tree ([#17275](https://github.com/opensearch-project/OpenSearch/pull/17275))
39+
- Add `ApproximateMatchAllQuery` that targets match_all queries and approximates sorts ([#17772](https://github.com/opensearch-project/OpenSearch/pull/17772))
40+
- Add TermsQuery support to Search GRPC endpoint ([#17888](https://github.com/opensearch-project/OpenSearch/pull/17888))
41+
- Support sub agg in filter rewrite optimization ([#17447](https://github.com/opensearch-project/OpenSearch/pull/17447)
42+
- Disable scoring of keyword term search by default, fallback logic with new use_similarity:true parameter ([#17889](https://github.com/opensearch-project/OpenSearch/pull/17889))
3143

3244
### Changed
3345
- Migrate BC libs to their FIPS counterparts ([#14912](https://github.com/opensearch-project/OpenSearch/pull/14912))
3446
- Increase the floor segment size to 16MB ([#17699](https://github.com/opensearch-project/OpenSearch/pull/17699))
3547
- Unwrap singleton DocValues in global ordinal value source of composite histogram aggregation ([#17740](https://github.com/opensearch-project/OpenSearch/pull/17740))
3648
- Unwrap singleton DocValues in date histogram aggregation. ([#17643](https://github.com/opensearch-project/OpenSearch/pull/17643))
3749
- Introduce 512 byte limit to search and ingest pipeline IDs ([#17786](https://github.com/opensearch-project/OpenSearch/pull/17786))
50+
- Avoid skewed segment replication lag metric ([#17831](https://github.com/opensearch-project/OpenSearch/pull/17831))
51+
- Increase the default segment counter step size when replica promoting ([#17568](https://github.com/opensearch-project/OpenSearch/pull/17568))
52+
- [WLM] Rename QueryGroup to WorkloadGroup ([#17901](https://github.com/opensearch-project/OpenSearch/pull/17901))
3853

3954
### Dependencies
4055
- Bump `com.nimbusds:nimbus-jose-jwt` from 9.41.1 to 10.0.2 ([#17607](https://github.com/opensearch-project/OpenSearch/pull/17607), [#17669](https://github.com/opensearch-project/OpenSearch/pull/17669))
@@ -55,17 +70,21 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5570
- Bump `reactor_netty` from 1.1.26 to 1.2.3 ([#17322](https://github.com/opensearch-project/OpenSearch/pull/17322), [#17377](https://github.com/opensearch-project/OpenSearch/pull/17377))
5671
- Bump `com.google.api.grpc:proto-google-iam-v1` from 1.33.0 to 1.49.1 ([#17811](https://github.com/opensearch-project/OpenSearch/pull/17811))
5772
- Bump `com.azure:azure-core` from 1.54.1 to 1.55.3 ([#17810](https://github.com/opensearch-project/OpenSearch/pull/17810))
73+
- Bump `org.apache.poi` version from 5.2.5 to 5.4.1 in /plugins/ingest-attachment ([#17887](https://github.com/opensearch-project/OpenSearch/pull/17887))
74+
- Bump `org.opensearch:protobufs` from 0.2.0 to 0.3.0 ([#17888](https://github.com/opensearch-project/OpenSearch/pull/17888))
5875

5976
### Changed
6077

6178
### Deprecated
6279

6380
### Removed
6481
- Remove deprecated `batch_size` parameter from `_bulk` ([#14283](https://github.com/opensearch-project/OpenSearch/issues/14283))
82+
- Remove `FeatureFlags.APPROXIMATE_POINT_RANGE_QUERY_SETTING` since range query approximation is no longer experimental ([#17769](https://github.com/opensearch-project/OpenSearch/pull/17769))
6583

6684
### Fixed
6785
- Fix bytes parameter on `_cat/recovery` ([#17598](https://github.com/opensearch-project/OpenSearch/pull/17598))
6886
- Fix slow performance of FeatureFlag checks ([#17611](https://github.com/opensearch-project/OpenSearch/pull/17611))
87+
- Fix shard recovery in pull-based ingestion to avoid skipping messages ([#17868](https://github.com/opensearch-project/OpenSearch/pull/17868)))
6988

7089
### Security
7190

build.gradle

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -433,11 +433,12 @@ gradle.projectsEvaluated {
433433

434434
project.tasks.withType(Test) { task ->
435435
if (task != null) {
436-
if (BuildParams.runtimeJavaVersion > JavaVersion.VERSION_17) {
437-
task.jvmArgs += ["-Djava.security.manager=allow"]
438-
}
439-
if (BuildParams.runtimeJavaVersion >= JavaVersion.VERSION_20) {
440-
task.jvmArgs += ["--add-modules=jdk.incubator.vector"]
436+
task.jvmArgs += ["--add-modules=jdk.incubator.vector"]
437+
438+
// Add Java Agent for security sandboxing
439+
if (!(project.path in [':build-tools', ":libs:agent-sm:bootstrap", ":libs:agent-sm:agent"])) {
440+
dependsOn(project(':libs:agent-sm:agent').prepareAgent)
441+
jvmArgs += ["-javaagent:" + project(':libs:agent-sm:agent').jar.archiveFile.get()]
441442
}
442443
}
443444
}

buildSrc/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,12 @@ dependencies {
110110
api 'com.netflix.nebula:gradle-info-plugin:12.1.6'
111111
api 'org.apache.rat:apache-rat:0.15'
112112
api "commons-io:commons-io:${props.getProperty('commonsio')}"
113-
api "net.java.dev.jna:jna:5.14.0"
113+
api "net.java.dev.jna:jna:5.16.0"
114114
api 'com.gradleup.shadow:shadow-gradle-plugin:8.3.5'
115115
api 'org.jdom:jdom2:2.0.6.1'
116116
api "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${props.getProperty('kotlin')}"
117117
api 'de.thetaphi:forbiddenapis:3.8'
118-
api 'com.avast.gradle:gradle-docker-compose-plugin:0.17.6'
118+
api 'com.avast.gradle:gradle-docker-compose-plugin:0.17.12'
119119
api "org.yaml:snakeyaml:${props.getProperty('snakeyaml')}"
120120
api 'org.apache.maven:maven-model:3.9.6'
121121
api 'com.networknt:json-schema-validator:1.2.0'

buildSrc/src/main/java/org/opensearch/gradle/OpenSearchTestBasePlugin.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,6 @@ public void execute(Task t) {
115115
test.jvmArgs("--illegal-access=warn");
116116
}
117117
}
118-
if (test.getJavaVersion().compareTo(JavaVersion.VERSION_17) > 0) {
119-
test.jvmArgs("-Djava.security.manager=allow");
120-
}
121118
}
122119
});
123120
test.getJvmArgumentProviders().add(nonInputProperties);
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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.gradle.agent;
10+
11+
import org.gradle.api.Plugin;
12+
import org.gradle.api.Project;
13+
import org.gradle.api.artifacts.Configuration;
14+
import org.gradle.api.tasks.Copy;
15+
import org.gradle.api.tasks.TaskProvider;
16+
import org.gradle.api.tasks.testing.Test;
17+
18+
import java.io.File;
19+
import java.util.Objects;
20+
21+
/**
22+
* Gradle plugin to automatically configure the OpenSearch Java agent
23+
* for test tasks in OpenSearch plugin projects.
24+
*/
25+
public class JavaAgent implements Plugin<Project> {
26+
27+
/**
28+
* Plugin implementation that sets up java agent configuration and applies it to test tasks.
29+
*/
30+
@Override
31+
public void apply(Project project) {
32+
Configuration agentConfiguration = project.getConfigurations().findByName("agent");
33+
if (agentConfiguration == null) {
34+
agentConfiguration = project.getConfigurations().create("agent");
35+
}
36+
37+
project.afterEvaluate(p -> {
38+
String opensearchVersion = getOpensearchVersion(p);
39+
p.getDependencies().add("agent", "org.opensearch:opensearch-agent-bootstrap:" + opensearchVersion);
40+
p.getDependencies().add("agent", "org.opensearch:opensearch-agent:" + opensearchVersion);
41+
});
42+
43+
Configuration finalAgentConfiguration = agentConfiguration;
44+
TaskProvider<Copy> prepareJavaAgent = project.getTasks().register("prepareJavaAgent", Copy.class, task -> {
45+
task.from(finalAgentConfiguration);
46+
task.into(new File(project.getBuildDir(), "agent"));
47+
});
48+
49+
project.getTasks().withType(Test.class).configureEach(testTask -> {
50+
testTask.dependsOn(prepareJavaAgent);
51+
52+
final String opensearchVersion = getOpensearchVersion(project);
53+
54+
testTask.doFirst(task -> {
55+
File agentJar = new File(project.getBuildDir(), "agent/opensearch-agent-" + opensearchVersion + ".jar");
56+
57+
testTask.jvmArgs("-javaagent:" + agentJar.getAbsolutePath());
58+
});
59+
});
60+
}
61+
62+
/**
63+
* Gets the OpenSearch version from project properties, with a fallback default.
64+
*
65+
* @param project The Gradle project
66+
* @return The OpenSearch version to use
67+
*/
68+
private String getOpensearchVersion(Project project) {
69+
return Objects.requireNonNull(project.property("opensearch_version")).toString();
70+
}
71+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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+
implementation-class=org.opensearch.gradle.agent.JavaAgent
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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.gradle.agent;
10+
11+
import org.opensearch.gradle.test.GradleUnitTestCase;
12+
import org.gradle.api.Project;
13+
import org.gradle.api.artifacts.Configuration;
14+
import org.gradle.api.tasks.Copy;
15+
import org.gradle.testfixtures.ProjectBuilder;
16+
import org.junit.After;
17+
import org.junit.Before;
18+
import org.junit.Test;
19+
import org.junit.rules.TemporaryFolder;
20+
21+
import java.io.File;
22+
import java.io.IOException;
23+
24+
public class JavaAgentTests extends GradleUnitTestCase {
25+
private TemporaryFolder projectDir;
26+
private final String PREPARE_JAVA_AGENT_TASK = "prepareJavaAgent";
27+
28+
@Before
29+
public void setUp() throws IOException {
30+
projectDir = new TemporaryFolder();
31+
projectDir.create();
32+
}
33+
34+
@After
35+
public void tearDown() {
36+
projectDir.delete();
37+
}
38+
39+
/**
40+
* This test is used to verify that adding the 'opensearch.java-agent' to the project
41+
* creates the necessary agent configuration and tasks. This is basically
42+
* a behavioral test of the {@link JavaAgent#apply(Project)} method.
43+
*/
44+
@Test
45+
public void applyJavaAgentPlugin() {
46+
// Create an empty project and apply the JavaAgent plugin
47+
Project project = ProjectBuilder.builder().build();
48+
project.getPluginManager().apply(JavaAgent.class);
49+
50+
// Verify the agent configuration was created
51+
Configuration agentConfig = project.getConfigurations().findByName("agent");
52+
assertNotNull("Agent configuration should be created", agentConfig);
53+
54+
// Verify the prepareJavaAgent task was created and is of the right type
55+
assertNotNull("prepareJavaAgent task should be created", project.getTasks().findByName(PREPARE_JAVA_AGENT_TASK));
56+
assertTrue("prepareJavaAgent task should be of type Copy", project.getTasks().findByName(PREPARE_JAVA_AGENT_TASK) instanceof Copy);
57+
58+
// Verify the destination directory of the Copy task
59+
Copy prepareTask = (Copy) project.getTasks().findByName(PREPARE_JAVA_AGENT_TASK);
60+
assertEquals(
61+
"Destination directory should be build/agent",
62+
new File(project.getBuildDir(), "agent"),
63+
prepareTask.getDestinationDir()
64+
);
65+
}
66+
}

client/rest-high-level/src/test/resources/org/opensearch/bootstrap/test.policy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@
88

99
grant {
1010
permission java.net.SocketPermission "*", "connect,resolve";
11+
permission java.net.NetPermission "accessUnixDomainSocket";
1112
};

distribution/archives/build.gradle

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ CopySpec archiveFiles(CopySpec modulesFiles, String distributionType, String pla
3838
into('lib') {
3939
with libFiles()
4040
}
41+
into('agent') {
42+
with agentFiles()
43+
}
4144
into('config') {
4245
dirPermissions {
4346
unix 0750
@@ -226,3 +229,9 @@ subprojects {
226229

227230
group = "org.opensearch.distribution"
228231
}
232+
233+
tasks.each {
234+
if (it.name.startsWith("build")) {
235+
it.dependsOn project(':libs:agent-sm:agent').assemble
236+
}
237+
}

distribution/build.gradle

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,18 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) {
357357
}
358358
}
359359

360+
agentFiles = {
361+
copySpec {
362+
from(project(':libs:agent-sm:agent').prepareAgent) {
363+
include '**/*.jar'
364+
exclude '**/*-javadoc.jar'
365+
exclude '**/*-sources.jar'
366+
// strip the version since jvm.options is using agent without version
367+
rename("opensearch-agent-${project.version}.jar", "opensearch-agent.jar")
368+
}
369+
}
370+
}
371+
360372
modulesFiles = { platform ->
361373
copySpec {
362374
eachFile {

0 commit comments

Comments
 (0)