Skip to content

Commit 6ebee6d

Browse files
authored
Merge branch 'main' into fix_loop_in_updateRep
Signed-off-by: kkewwei <[email protected]>
2 parents 1f76f18 + 3638c13 commit 6ebee6d

File tree

456 files changed

+12516
-5995
lines changed

Some content is hidden

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

456 files changed

+12516
-5995
lines changed

.github/workflows/gradle-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- uses: actions/checkout@v4
2525
- name: Get changed files
2626
id: changed-files-specific
27-
uses: tj-actions/[email protected].4
27+
uses: tj-actions/[email protected].5
2828
with:
2929
files_ignore: |
3030
release-notes/*.md

CHANGELOG.md

Lines changed: 1 addition & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -5,81 +5,20 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55

66
## [Unreleased 3.x]
77
### Added
8-
- Change priority for scheduling reroute during timeout([#16445](https://github.com/opensearch-project/OpenSearch/pull/16445))
9-
- [Rule Based Auto-tagging] Add rule schema for auto tagging ([#17238](https://github.com/opensearch-project/OpenSearch/pull/17238))
10-
- Renaming the node role search to warm ([#17573](https://github.com/opensearch-project/OpenSearch/pull/17573))
11-
- Introduce a new search node role to hold search only shards ([#17620](https://github.com/opensearch-project/OpenSearch/pull/17620))
12-
- Fix systemd integTest on deb regarding path ownership check ([#17641](https://github.com/opensearch-project/OpenSearch/pull/17641))
13-
- Add dfs transformation function in XContentMapValues ([#17612](https://github.com/opensearch-project/OpenSearch/pull/17612))
14-
- Add tracking for long-running SearchTask post cancellation ([#17726](https://github.com/opensearch-project/OpenSearch/pull/17726))
15-
- Added Kinesis support as a plugin for the pull-based ingestion ([#17615](https://github.com/opensearch-project/OpenSearch/pull/17615))
16-
- Add FilterFieldType for developers who want to wrap MappedFieldType ([#17627](https://github.com/opensearch-project/OpenSearch/pull/17627))
17-
- [Rule Based Auto-tagging] Add in-memory rule processing service ([#17365](https://github.com/opensearch-project/OpenSearch/pull/17365))
18-
- [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))
20-
- Add ingestion management APIs for pause, resume and get ingestion state ([#17631](https://github.com/opensearch-project/OpenSearch/pull/17631))
21-
- [Security Manager Replacement] Enhance Java Agent to intercept System::exit ([#17746](https://github.com/opensearch-project/OpenSearch/pull/17746))
22-
- [Security Manager Replacement] Add a policy parser for Java agent security policies ([#17753](https://github.com/opensearch-project/OpenSearch/pull/17753))
23-
- [Security Manager Replacement] Implement File Interceptor and add integration tests ([#17760](https://github.com/opensearch-project/OpenSearch/pull/17760))
24-
- [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))
26-
- 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))
28-
- 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))
30-
- Add GRPC DocumentService and Bulk endpoint ([#17727](https://github.com/opensearch-project/OpenSearch/pull/17727))
31-
- Added scale to zero (`search_only` mode) support for OpenSearch reader writer separation ([#17299](https://github.com/opensearch-project/OpenSearch/pull/17299)
32-
- [Star Tree] [Search] Resolving numeric range aggregation with metric aggregation using star-tree ([#17273](https://github.com/opensearch-project/OpenSearch/pull/17273))
33-
- Added Search Only strict routing setting ([#17803](https://github.com/opensearch-project/OpenSearch/pull/17803))
34-
- 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))
388

399
### Changed
40-
- Migrate BC libs to their FIPS counterparts ([#14912](https://github.com/opensearch-project/OpenSearch/pull/14912))
41-
- Increase the floor segment size to 16MB ([#17699](https://github.com/opensearch-project/OpenSearch/pull/17699))
42-
- Unwrap singleton DocValues in global ordinal value source of composite histogram aggregation ([#17740](https://github.com/opensearch-project/OpenSearch/pull/17740))
43-
- Unwrap singleton DocValues in date histogram aggregation. ([#17643](https://github.com/opensearch-project/OpenSearch/pull/17643))
44-
- Introduce 512 byte limit to search and ingest pipeline IDs ([#17786](https://github.com/opensearch-project/OpenSearch/pull/17786))
45-
- Avoid skewed segment replication lag metric ([#17831](https://github.com/opensearch-project/OpenSearch/pull/17831))
46-
- Increase the default segment counter step size when replica promoting ([#17568](https://github.com/opensearch-project/OpenSearch/pull/17568))
4710

4811
### Dependencies
49-
- 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))
50-
- Bump `com.google.api:api-common` from 1.8.1 to 2.46.1 ([#17604](https://github.com/opensearch-project/OpenSearch/pull/17604))
51-
- Bump `ch.qos.logback:logback-core` from 1.5.16 to 1.5.18 ([#17609](https://github.com/opensearch-project/OpenSearch/pull/17609), [#17809](https://github.com/opensearch-project/OpenSearch/pull/17809))
52-
- Bump `org.jruby.joni:joni` from 2.2.3 to 2.2.6 ([#17608](https://github.com/opensearch-project/OpenSearch/pull/17608), [#17732](https://github.com/opensearch-project/OpenSearch/pull/17732))
53-
- Bump `dangoslen/dependabot-changelog-helper` from 3 to 4 ([#17498](https://github.com/opensearch-project/OpenSearch/pull/17498))
54-
- Bump `com.google.api:gax` from 2.35.0 to 2.63.1 ([#17465](https://github.com/opensearch-project/OpenSearch/pull/17465))
55-
- Bump `com.azure:azure-storage-blob` from 12.29.1 to 12.30.0 ([#17667](https://github.com/opensearch-project/OpenSearch/pull/17667))
56-
- Bump `tj-actions/changed-files` from 46.0.1 to 46.0.4 ([#17666](https://github.com/opensearch-project/OpenSearch/pull/17666), [#17813](https://github.com/opensearch-project/OpenSearch/pull/17813))
57-
- Bump `com.google.code.gson:gson` from 2.11.0 to 2.12.1 ([#17668](https://github.com/opensearch-project/OpenSearch/pull/17668))
58-
- Bump `com.github.luben:zstd-jni` from 1.5.5-1 to 1.5.6-1 ([#17674](https://github.com/opensearch-project/OpenSearch/pull/17674))
59-
- Bump `lycheeverse/lychee-action` from 2.3.0 to 2.4.0 ([#17731](https://github.com/opensearch-project/OpenSearch/pull/17731))
60-
- Bump `com.netflix.nebula.ospackage-base` from 11.11.1 to 11.11.2 ([#17734](https://github.com/opensearch-project/OpenSearch/pull/17734))
61-
- Bump `com.nimbusds:oauth2-oidc-sdk` from 11.21 to 11.23.1 ([#17729](https://github.com/opensearch-project/OpenSearch/pull/17729))
62-
- Bump `com.google.api.grpc:proto-google-common-protos` from 2.52.0 to 2.54.1 ([#17733](https://github.com/opensearch-project/OpenSearch/pull/17733))
63-
- Bump `ch.qos.logback:logback-classic` from 1.5.17 to 1.5.18 ([#17730](https://github.com/opensearch-project/OpenSearch/pull/17730))
64-
- 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))
65-
- 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))
66-
- Bump `com.azure:azure-core` from 1.54.1 to 1.55.3 ([#17810](https://github.com/opensearch-project/OpenSearch/pull/17810))
67-
- 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))
6812

6913
### Changed
7014

7115
### Deprecated
7216

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

7719
### Fixed
78-
- Fix bytes parameter on `_cat/recovery` ([#17598](https://github.com/opensearch-project/OpenSearch/pull/17598))
79-
- Fix slow performance of FeatureFlag checks ([#17611](https://github.com/opensearch-project/OpenSearch/pull/17611))
80-
- Fix shard recovery in pull-based ingestion to avoid skipping messages ([#17868](https://github.com/opensearch-project/OpenSearch/pull/17868)))
8120
- Fix simultaneously creating a snapshot and updating the repository can potentially trigger an infinite loop ([#17532](https://github.com/opensearch-project/OpenSearch/pull/17532))
8221

8322
### Security
8423

85-
[Unreleased 2.x]: https://github.com/opensearch-project/OpenSearch/compare/f58d846f...main
24+
[Unreleased 3.x]: https://github.com/opensearch-project/OpenSearch/compare/aa0e724e...main

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,4 @@ Copyright OpenSearch Contributors. See [NOTICE](NOTICE.txt) for details.
6161
OpenSearch is a registered trademark of Amazon Web Services.
6262

6363
OpenSearch includes certain Apache-licensed Elasticsearch code from Elasticsearch B.V. and other source code. Elasticsearch B.V. is not the source of that other source code. ELASTICSEARCH is a registered trademark of Elasticsearch B.V.
64+
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+
}

distribution/packages/build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,9 @@ Closure commonPackageConfig(String type, boolean jdk, String architecture) {
175175
with jdkFiles(project, 'linux', architecture)
176176
}
177177
}
178+
into('agent') {
179+
with agentFiles()
180+
}
178181
// we need to specify every intermediate directory in these paths so the package managers know they are explicitly
179182
// intended to manage them; otherwise they may be left behind on uninstallation. duplicate calls of the same
180183
// directory are fine

distribution/src/config/jvm.options

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,4 @@ ${error.file}
8585
23:-XX:CompileCommand=dontinline,java/lang/invoke/MethodHandle.asTypeUncached
8686

8787
21-:-javaagent:agent/opensearch-agent.jar
88+
21-:--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED

gradle/ide.gradle

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ if (System.getProperty('idea.active') == 'true') {
4949
}
5050
}
5151

52-
buildScan {
53-
server = 'https://127.0.0.1'
54-
}
55-
5652
idea {
5753
project {
5854
vcs = 'Git'

gradle/run.gradle

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,17 @@ testClusters {
4343
installedPlugins = Eval.me(installedPlugins)
4444
for (String p : installedPlugins) {
4545
plugin('plugins:'.concat(p))
46+
if (p.equals("arrow-flight-rpc")) {
47+
// Add system properties for Netty configuration
48+
systemProperty 'io.netty.allocator.numDirectArenas', '1'
49+
systemProperty 'io.netty.noUnsafe', 'false'
50+
systemProperty 'io.netty.tryUnsafe', 'true'
51+
systemProperty 'io.netty.tryReflectionSetAccessible', 'true'
52+
}
4653
}
4754
}
4855
}
56+
4957
}
5058

5159
tasks.register("run", RunTask) {

libs/agent-sm/agent-policy/src/main/java/org/opensearch/secure_sm/policy/PolicyFile.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ public class PolicyFile extends java.security.Policy {
4949
"org.bouncycastle.crypto.CryptoServicesPermission",
5050
"org.opensearch.script.ClassPermission",
5151
"javax.security.auth.AuthPermission",
52-
"javax.security.auth.kerberos.ServicePermission"
52+
"javax.security.auth.kerberos.ServicePermission",
53+
"com.sun.tools.attach.AttachPermission"
5354
);
5455

5556
private final PolicyInfo policyInfo;

libs/arrow-spi/build.gradle

Lines changed: 0 additions & 20 deletions
This file was deleted.

modules/analysis-common/src/yamlRestTest/resources/rest-api-spec/test/cluster.stats/10_analysis_stats.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
---
22
"get cluster stats returns analysis stats":
33

4-
- skip:
5-
version: " - 7.6.99"
6-
reason: "analysis stats are added for v7.7.0"
74

85
- do:
96
cluster.stats: {}

modules/analysis-common/src/yamlRestTest/resources/rest-api-spec/test/search.query/70_intervals.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ setup:
2222

2323
---
2424
"Test use_field":
25-
- skip:
26-
version: " - 7.1.99"
27-
reason: "Implemented in 7.2"
2825
- do:
2926
search:
3027
index: test

modules/geo/src/yamlRestTest/resources/rest-api-spec/test/geo_shape/230_composite.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,6 @@ setup:
8383
index: [test, other]
8484
---
8585
"Simple Composite aggregation with GeoTile grid":
86-
- skip:
87-
version: " - 7.4.99"
88-
reason: geotile_grid is not supported until 7.5.0
8986
- do:
9087
search:
9188
rest_total_hits_as_int: true
@@ -127,9 +124,6 @@ setup:
127124

128125
---
129126
"Simple Composite aggregation with geotile grid add aggregate after":
130-
- skip:
131-
version: " - 7.4.99"
132-
reason: geotile_grid is not supported until 7.5.0
133127
- do:
134128
search:
135129
index: test

modules/lang-painless/src/yamlRestTest/resources/rest-api-spec/test/painless/17_update_error.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
---
22
"Script errors contain position":
3-
- skip:
4-
version: " - 7.7.0"
5-
reason: "position introduced in 7.7"
3+
64

75
- do:
86
catch: /compile error/

modules/lang-painless/src/yamlRestTest/resources/rest-api-spec/test/painless/80_script_score.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -500,9 +500,7 @@
500500

501501
---
502502
"Script Score With Highlight":
503-
- skip:
504-
version: " - 7.4.0"
505-
reason: "highlight for script_score was introduced in 7.4.1"
503+
506504

507505
- do:
508506
indices.create:

modules/lang-painless/src/yamlRestTest/resources/rest-api-spec/test/painless/85_script_score_random_score.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
# Integration tests for ScriptScoreQuery using Painless
22

3-
setup:
4-
- skip:
5-
version: " - 7.1.99"
6-
reason: "random score function of script score was added in 7.2"
7-
83
---
94
"Random score function with _seq_no field":
105
- do:

0 commit comments

Comments
 (0)