Skip to content

Commit 29b3076

Browse files
authored
Merge branch 'main' into optimize_nodes_api
Signed-off-by: kkewwei <kewei.11@bytedance.com>
2 parents 2d43f6e + b75f27a commit 29b3076

File tree

333 files changed

+20299
-1469
lines changed

Some content is hidden

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

333 files changed

+20299
-1469
lines changed

.ci/bwcVersions

+1
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,5 @@ BWC_VERSION:
4141
- "2.17.1"
4242
- "2.17.2"
4343
- "2.18.0"
44+
- "2.18.1"
4445
- "2.19.0"

.github/workflows/detect-breaking-change.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
with:
1818
cache-disabled: true
1919
arguments: japicmp
20-
gradle-version: 8.7
20+
gradle-version: 8.11
2121
build-root-directory: server
2222
- if: failure()
2323
run: cat server/build/reports/java-compatibility/report.txt

.github/workflows/gradle-check.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ jobs:
115115
116116
- name: Upload Coverage Report
117117
if: success()
118-
uses: codecov/codecov-action@v4
118+
uses: codecov/codecov-action@v5
119119
with:
120120
token: ${{ secrets.CODECOV_TOKEN }}
121121
files: ./codeCoverage.xml

.github/workflows/links.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- uses: actions/checkout@v4
1414
- name: lychee Link Checker
1515
id: lychee
16-
uses: lycheeverse/lychee-action@v2.0.2
16+
uses: lycheeverse/lychee-action@v2.1.0
1717
with:
1818
args: --accept=200,403,429 --exclude-mail **/*.html **/*.md **/*.txt **/*.json --exclude-file .lychee.excludes
1919
fail: true

CHANGELOG.md

+35-1
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,42 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55

66
## [Unreleased 2.x]
77
### Added
8-
- MultiTermQueries in keyword fields now default to `indexed` approach and gated behind cluster setting ([#15637](https://github.com/opensearch-project/OpenSearch/pull/15637))
98
- Latency and Memory allocation improvements to Multi Term Aggregation queries ([#14993](https://github.com/opensearch-project/OpenSearch/pull/14993))
109
- Add support for restoring from snapshot with search replicas ([#16111](https://github.com/opensearch-project/OpenSearch/pull/16111))
10+
- Ensure support of the transport-nio by security plugin ([#16474](https://github.com/opensearch-project/OpenSearch/pull/16474))
1111
- Add logic in master service to optimize performance and retain detailed logging for critical cluster operations. ([#14795](https://github.com/opensearch-project/OpenSearch/pull/14795))
1212
- Add Setting to adjust the primary constraint weights ([#16471](https://github.com/opensearch-project/OpenSearch/pull/16471))
1313
- Switch from `buildSrc/version.properties` to Gradle version catalog (`gradle/libs.versions.toml`) to enable dependabot to perform automated upgrades on common libs ([#16284](https://github.com/opensearch-project/OpenSearch/pull/16284))
14+
- Increase segrep pressure checkpoint default limit to 30 ([#16577](https://github.com/opensearch-project/OpenSearch/pull/16577/files))
15+
- Add dynamic setting allowing size > 0 requests to be cached in the request cache ([#16483](https://github.com/opensearch-project/OpenSearch/pull/16483))
16+
- Support installing plugin SNAPSHOTs with SNASPHOT distribution ([#16581](https://github.com/opensearch-project/OpenSearch/pull/16581))
17+
- Make IndexStoreListener a pluggable interface ([#16583](https://github.com/opensearch-project/OpenSearch/pull/16583))
18+
- Support for keyword fields in star-tree index ([#16233](https://github.com/opensearch-project/OpenSearch/pull/16233))
19+
- Add a flag in QueryShardContext to differentiate inner hit query ([#16600](https://github.com/opensearch-project/OpenSearch/pull/16600))
20+
- Add vertical scaling and SoftReference for snapshot repository data cache ([#16489](https://github.com/opensearch-project/OpenSearch/pull/16489))
21+
- Support prefix list for remote repository attributes([#16271](https://github.com/opensearch-project/OpenSearch/pull/16271))
22+
- Add new configuration setting `synonym_analyzer`, to the `synonym` and `synonym_graph` filters, enabling the specification of a custom analyzer for reading the synonym file ([#16488](https://github.com/opensearch-project/OpenSearch/pull/16488)).
23+
- Add stats for remote publication failure and move download failure stats to remote methods([#16682](https://github.com/opensearch-project/OpenSearch/pull/16682/))
1424

1525
### Dependencies
26+
- Bump `com.google.cloud:google-cloud-core-http` from 2.23.0 to 2.47.0 ([#16504](https://github.com/opensearch-project/OpenSearch/pull/16504))
27+
- Bump `google-auth-library-oauth2-http` from 1.7.0 to 1.29.0 in /plugins/repository-gcs ([#16520](https://github.com/opensearch-project/OpenSearch/pull/16520))
28+
- Bump `com.azure:azure-storage-common` from 12.25.1 to 12.27.1 ([#16521](https://github.com/opensearch-project/OpenSearch/pull/16521))
29+
- Bump `com.google.apis:google-api-services-compute` from v1-rev20240407-2.0.0 to v1-rev20241105-2.0.0 ([#16502](https://github.com/opensearch-project/OpenSearch/pull/16502), [#16548](https://github.com/opensearch-project/OpenSearch/pull/16548), [#16613](https://github.com/opensearch-project/OpenSearch/pull/16613))
30+
- Bump `com.azure:azure-storage-blob` from 12.23.0 to 12.28.1 ([#16501](https://github.com/opensearch-project/OpenSearch/pull/16501))
31+
- Bump `org.apache.hadoop:hadoop-minicluster` from 3.4.0 to 3.4.1 ([#16550](https://github.com/opensearch-project/OpenSearch/pull/16550))
32+
- Bump `org.apache.xmlbeans:xmlbeans` from 5.2.1 to 5.2.2 ([#16612](https://github.com/opensearch-project/OpenSearch/pull/16612))
33+
- Bump `com.nimbusds:nimbus-jose-jwt` from 9.41.1 to 9.46 ([#16611](https://github.com/opensearch-project/OpenSearch/pull/16611))
34+
- Bump `lycheeverse/lychee-action` from 2.0.2 to 2.1.0 ([#16610](https://github.com/opensearch-project/OpenSearch/pull/16610))
35+
- Bump `me.champeau.gradle.japicmp` from 0.4.4 to 0.4.5 ([#16614](https://github.com/opensearch-project/OpenSearch/pull/16614))
36+
- Bump `mockito` from 5.14.1 to 5.14.2, `objenesis` from 3.2 to 3.3 and `bytebuddy` from 1.15.4 to 1.15.10 ([#16655](https://github.com/opensearch-project/OpenSearch/pull/16655))
37+
- Bump `Netty` from 4.1.114.Final to 4.1.115.Final ([#16661](https://github.com/opensearch-project/OpenSearch/pull/16661))
38+
- Bump `org.xerial.snappy:snappy-java` from 1.1.10.6 to 1.1.10.7 ([#16665](https://github.com/opensearch-project/OpenSearch/pull/16665))
39+
- Bump `codecov/codecov-action` from 4 to 5 ([#16667](https://github.com/opensearch-project/OpenSearch/pull/16667))
40+
- Bump `org.apache.logging.log4j:log4j-core` from 2.24.1 to 2.24.2 ([#16718](https://github.com/opensearch-project/OpenSearch/pull/16718))
1641

1742
### Changed
43+
- Indexed IP field supports `terms_query` with more than 1025 IP masks [#16391](https://github.com/opensearch-project/OpenSearch/pull/16391)
1844
- Cancellation support for cat/nodes and optimize it ([#14853](https://github.com/opensearch-project/OpenSearch/pull/14853))
1945

2046
### Deprecated
@@ -24,6 +50,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
2450
### Fixed
2551
- Fix get index settings API doesn't show `number_of_routing_shards` setting when it was explicitly set ([#16294](https://github.com/opensearch-project/OpenSearch/pull/16294))
2652
- Revert changes to upload remote state manifest using minimum codec version([#16403](https://github.com/opensearch-project/OpenSearch/pull/16403))
53+
- Ensure index templates are not applied to system indices ([#16418](https://github.com/opensearch-project/OpenSearch/pull/16418))
54+
- Remove resource usages object from search response headers ([#16532](https://github.com/opensearch-project/OpenSearch/pull/16532))
55+
- Support retrieving doc values of unsigned long field ([#16543](https://github.com/opensearch-project/OpenSearch/pull/16543))
56+
- Fix rollover alias supports restored searchable snapshot index([#16483](https://github.com/opensearch-project/OpenSearch/pull/16483))
57+
- Fix permissions error on scripted query against remote snapshot ([#16544](https://github.com/opensearch-project/OpenSearch/pull/16544))
58+
- Fix `doc_values` only (`index:false`) IP field searching for masks ([#16628](https://github.com/opensearch-project/OpenSearch/pull/16628))
59+
- Fix stale cluster state custom file deletion ([#16670](https://github.com/opensearch-project/OpenSearch/pull/16670))
60+
- [Tiered Caching] Fix bug in cache stats API ([#16560](https://github.com/opensearch-project/OpenSearch/pull/16560))
2761

2862
### Security
2963

DEVELOPER_GUIDE.md

+10-23
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
- [Getting Started](#getting-started)
33
- [Git Clone OpenSearch Repo](#git-clone-opensearch-repo)
44
- [Install Prerequisites](#install-prerequisites)
5-
- [JDK 11](#jdk-11)
6-
- [JDK 14](#jdk-14)
7-
- [JDK 17](#jdk-17)
5+
- [JDK](#jdk)
86
- [Custom Runtime JDK](#custom-runtime-jdk)
97
- [Windows](#windows)
108
- [Docker](#docker)
@@ -76,35 +74,24 @@ Fork [opensearch-project/OpenSearch](https://github.com/opensearch-project/OpenS
7674

7775
### Install Prerequisites
7876

79-
#### JDK 11
77+
#### JDK
8078

81-
OpenSearch builds using Java 11 at a minimum, using the Adoptium distribution. This means you must have a JDK 11 installed with the environment variable `JAVA_HOME` referencing the path to Java home for your JDK 11 installation, e.g. `JAVA_HOME=/usr/lib/jvm/jdk-11`. This is configured in [buildSrc/build.gradle](buildSrc/build.gradle) and [distribution/tools/java-version-checker/build.gradle](distribution/tools/java-version-checker/build.gradle).
79+
OpenSearch recommends building with the [Temurin/Adoptium](https://adoptium.net/temurin/releases/) distribution. JDK 11 is the minimum supported, and JDK-23 is the newest supported. You must have a supported JDK installed with the environment variable `JAVA_HOME` referencing the path to Java home for your JDK installation, e.g. `JAVA_HOME=/usr/lib/jvm/jdk-21`.
8280

83-
```
84-
allprojects {
85-
targetCompatibility = JavaVersion.VERSION_11
86-
sourceCompatibility = JavaVersion.VERSION_11
87-
}
88-
```
81+
Download Java 11 from [here](https://adoptium.net/releases.html?variant=openjdk11).
8982

90-
```
91-
sourceCompatibility = JavaVersion.VERSION_11
92-
targetCompatibility = JavaVersion.VERSION_11
93-
```
9483

95-
Download Java 11 from [here](https://adoptium.net/releases.html?variant=openjdk11).
84+
In addition, certain backward compatibility tests check out and compile the previous major version of OpenSearch, and therefore require installing [JDK 11](https://adoptium.net/temurin/releases/?version=11) and [JDK 17](https://adoptium.net/temurin/releases/?version=17) and setting the `JAVA11_HOME` and `JAVA17_HOME` environment variables. More to that, since 8.10 release, Gradle has deprecated the usage of the any JDKs below JDK-16. For smooth development experience, the recommendation is to install at least [JDK 17](https://adoptium.net/temurin/releases/?version=17) or [JDK 21](https://adoptium.net/temurin/releases/?version=21). If you still want to build with JDK-11 only, please add `-Dorg.gradle.warning.mode=none` when invoking any Gradle build task from command line, for example:
9685

97-
#### JDK 14
98-
99-
To run the full suite of tests, download and install [JDK 14](https://jdk.java.net/archive/) and set `JAVA11_HOME`, and `JAVA14_HOME`. They are required by the [backwards compatibility test](./TESTING.md#testing-backwards-compatibility).
100-
101-
#### JDK 17
86+
```
87+
./gradlew check -Dorg.gradle.warning.mode=none
88+
```
10289

103-
By default, the test tasks use bundled JDK runtime, configured in [buildSrc/version.properties](buildSrc/version.properties), and set to JDK 17 (LTS).
90+
By default, the test tasks use bundled JDK runtime, configured in version catalog [gradle/libs.versions.toml](gradle/libs.versions.toml), and set to JDK 23 (non-LTS).
10491

10592
```
10693
bundled_jdk_vendor = adoptium
107-
bundled_jdk = 17.0.2+8
94+
bundled_jdk = 23.0.1+11
10895
```
10996

11097
#### Custom Runtime JDK

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
[![Security Vulnerabilities](https://img.shields.io/github/issues/opensearch-project/OpenSearch/security%20vulnerability?labelColor=red)](https://github.com/opensearch-project/OpenSearch/issues?q=is%3Aissue+is%3Aopen+label%3A"security%20vulnerability")
88
[![Open Issues](https://img.shields.io/github/issues/opensearch-project/OpenSearch)](https://github.com/opensearch-project/OpenSearch/issues)
99
[![Open Pull Requests](https://img.shields.io/github/issues-pr/opensearch-project/OpenSearch)](https://github.com/opensearch-project/OpenSearch/pulls)
10-
[![2.18.0 Open Issues](https://img.shields.io/github/issues/opensearch-project/OpenSearch/v2.18.0)](https://github.com/opensearch-project/OpenSearch/issues?q=is%3Aissue+is%3Aopen+label%3A"v2.18.0")
11-
[![2.17.2 Open Issues](https://img.shields.io/github/issues/opensearch-project/OpenSearch/v2.17.2)](https://github.com/opensearch-project/OpenSearch/issues?q=is%3Aissue+is%3Aopen+label%3A"v2.17.2")
10+
[![2.19.0 Open Issues](https://img.shields.io/github/issues/opensearch-project/OpenSearch/v2.19.0)](https://github.com/opensearch-project/OpenSearch/issues?q=is%3Aissue+is%3Aopen+label%3A"v2.19.0")
11+
[![2.18.1 Open Issues](https://img.shields.io/github/issues/opensearch-project/OpenSearch/v2.18.1)](https://github.com/opensearch-project/OpenSearch/issues?q=is%3Aissue+is%3Aopen+label%3A"v2.18.1")
1212
[![3.0.0 Open Issues](https://img.shields.io/github/issues/opensearch-project/OpenSearch/v3.0.0)](https://github.com/opensearch-project/OpenSearch/issues?q=is%3Aissue+is%3Aopen+label%3A"v3.0.0")
1313
[![GHA gradle check](https://github.com/opensearch-project/OpenSearch/actions/workflows/gradle-check.yml/badge.svg)](https://github.com/opensearch-project/OpenSearch/actions/workflows/gradle-check.yml)
1414
[![GHA validate pull request](https://github.com/opensearch-project/OpenSearch/actions/workflows/wrapper.yml/badge.svg)](https://github.com/opensearch-project/OpenSearch/actions/workflows/wrapper.yml)

build.gradle

+13-7
Original file line numberDiff line numberDiff line change
@@ -162,14 +162,20 @@ Map<String, String> buildMetadataMap = buildMetadataValue.tokenize(';').collectE
162162
return [key, value]
163163
}
164164

165-
/**
166-
* Using 'git' command line (if available), tries to fetch the commit date of the current revision
167-
* @return commit date of the current revision or 0 if it is not available
168-
*/
165+
// See please https://docs.gradle.org/8.11/userguide/service_injection.html#execoperations
166+
interface InjectedExecOps {
167+
@Inject ExecOperations getExecOps()
168+
}
169+
170+
/**
171+
* Using 'git' command line (if available), tries to fetch the commit date of the current revision
172+
* @return commit date of the current revision or 0 if it is not available
173+
*/
169174
long gitRevisionDate = {
175+
def execOps = project.objects.newInstance(InjectedExecOps)
170176
// Try to get last commit date as Unix timestamp
171177
try (ByteArrayOutputStream stdout = new ByteArrayOutputStream()) {
172-
ExecResult result = project.exec(spec -> {
178+
ExecResult result = execOps.execOps.exec(spec -> {
173179
spec.setIgnoreExitValue(true);
174180
spec.setStandardOutput(stdout);
175181
spec.commandLine("git", "log", "-1", "--format=%ct");
@@ -362,7 +368,7 @@ allprojects {
362368
if ((dep instanceof ProjectDependency) == false) {
363369
return
364370
}
365-
Project upstreamProject = dep.dependencyProject
371+
Project upstreamProject = project.project(dep.path)
366372
if (upstreamProject == null) {
367373
return
368374
}
@@ -438,7 +444,7 @@ gradle.projectsEvaluated {
438444

439445
configurations.matching { it.canBeResolved }.all { Configuration configuration ->
440446
dependencies.matching { it instanceof ProjectDependency }.all { ProjectDependency dep ->
441-
Project upstreamProject = dep.dependencyProject
447+
Project upstreamProject = project.project(dep.path)
442448
if (upstreamProject != null) {
443449
if (project.path == upstreamProject.path) {
444450
// TODO: distribution integ tests depend on themselves (!), fix that

buildSrc/src/main/groovy/org/opensearch/gradle/test/TestWithDependenciesPlugin.groovy

+6-3
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,12 @@ class TestWithDependenciesPlugin implements Plugin<Project> {
5656

5757
project.configurations.testImplementation.dependencies.all { Dependency dep ->
5858
// this closure is run every time a compile dependency is added
59-
if (dep instanceof ProjectDependency && dep.dependencyProject.plugins.hasPlugin(PluginBuildPlugin)) {
60-
project.gradle.projectsEvaluated {
61-
addPluginResources(project, dep.dependencyProject)
59+
if (dep instanceof ProjectDependency) {
60+
Project dependencyProject = project.project(((ProjectDependency)dep).path)
61+
if (dependencyProject.plugins.hasPlugin(PluginBuildPlugin)) {
62+
project.gradle.projectsEvaluated {
63+
addPluginResources(project, dependencyProject)
64+
}
6265
}
6366
}
6467
}

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

+9-2
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ public class LoggedExec extends Exec implements FileSystemOperationsAware {
7171
private Consumer<Logger> outputLogger;
7272
private FileSystemOperations fileSystemOperations;
7373

74+
interface InjectedExecOps {
75+
@Inject
76+
ExecOperations getExecOps();
77+
}
78+
7479
@Inject
7580
public LoggedExec(FileSystemOperations fileSystemOperations) {
7681
this.fileSystemOperations = fileSystemOperations;
@@ -133,15 +138,17 @@ public void setSpoolOutput(boolean spoolOutput) {
133138
}
134139

135140
public static ExecResult exec(Project project, Action<ExecSpec> action) {
136-
return genericExec(project::exec, action);
141+
final InjectedExecOps execOps = project.getObjects().newInstance(InjectedExecOps.class);
142+
return exec(execOps.getExecOps(), action);
137143
}
138144

139145
public static ExecResult exec(ExecOperations execOperations, Action<ExecSpec> action) {
140146
return genericExec(execOperations::exec, action);
141147
}
142148

143149
public static ExecResult javaexec(Project project, Action<JavaExecSpec> action) {
144-
return genericExec(project::javaexec, action);
150+
final InjectedExecOps execOps = project.getObjects().newInstance(InjectedExecOps.class);
151+
return genericExec(execOps.getExecOps()::javaexec, action);
145152
}
146153

147154
/** Returns JVM arguments suitable for a short-lived forked task */

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public String call() throws Exception {
121121
Node dependencyNode = dependenciesNode.appendNode("dependency");
122122
dependencyNode.appendNode("groupId", dependency.getGroup());
123123
ProjectDependency projectDependency = (ProjectDependency) dependency;
124-
String artifactId = getArchivesBaseName(projectDependency.getDependencyProject());
124+
String artifactId = getArchivesBaseName(project.project(projectDependency.getPath()));
125125
dependencyNode.appendNode("artifactId", artifactId);
126126
dependencyNode.appendNode("version", dependency.getVersion());
127127
dependencyNode.appendNode("scope", "compile");

0 commit comments

Comments
 (0)