Skip to content

Commit 9705456

Browse files
authored
Merge branch 'main' into aggregation-precomputation-rare-terms
Signed-off-by: Anthony Leong <aj.leong623@gmail.com>
2 parents 1778326 + 791faed commit 9705456

File tree

342 files changed

+10125
-2893
lines changed

Some content is hidden

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

342 files changed

+10125
-2893
lines changed

.github/workflows/stalled.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
private_key: ${{ secrets.APP_PRIVATE_KEY }}
1818
installation_id: 22958780
1919
- name: Stale PRs
20-
uses: actions/stale@v9
20+
uses: actions/stale@v10
2121
with:
2222
repo-token: ${{ steps.github_app_token.outputs.token }}
2323
stale-pr-label: 'stalled'

CHANGELOG.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,38 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
88
- Expand fetch phase profiling to support inner hits and top hits aggregation phases ([##18936](https://github.com/opensearch-project/OpenSearch/pull/18936))
99
- Add temporal routing processors for time-based document routing ([#18920](https://github.com/opensearch-project/OpenSearch/issues/18920))
1010
- Implement Query Rewriting Infrastructure ([#19060](https://github.com/opensearch-project/OpenSearch/pull/19060))
11-
- The dynamic mapping parameter supports false_allow_templates ([#19065](https://github.com/opensearch-project/OpenSearch/pull/19065))
11+
- The dynamic mapping parameter supports false_allow_templates ([#19065](https://github.com/opensearch-project/OpenSearch/pull/19065) ([#19097](https://github.com/opensearch-project/OpenSearch/pull/19097)))
1212
- Add a toBuilder method in EngineConfig to support easy modification of configs([#19054](https://github.com/opensearch-project/OpenSearch/pull/19054))
1313
- Add StoreFactory plugin interface for custom Store implementations([#19091](https://github.com/opensearch-project/OpenSearch/pull/19091))
1414
- Use S3CrtClient for higher throughput while uploading files to S3 ([#18800](https://github.com/opensearch-project/OpenSearch/pull/18800))
1515
- Add a dynamic setting to change skip_cache_factor and min_frequency for querycache ([#18351](https://github.com/opensearch-project/OpenSearch/issues/18351))
1616
- Add overload constructor for Translog to accept Channel Factory as a parameter ([#18918](https://github.com/opensearch-project/OpenSearch/pull/18918))
1717
- Add subdirectory-aware store module with recovery support ([#19132](https://github.com/opensearch-project/OpenSearch/pull/19132))
18+
- Field collapsing supports search_after ([#19261](https://github.com/opensearch-project/OpenSearch/pull/19261))
1819
- Add a dynamic cluster setting to control the enablement of the merged segment warmer ([#18929](https://github.com/opensearch-project/OpenSearch/pull/18929))
20+
- Publish transport-grpc-spi exposing QueryBuilderProtoConverter and QueryBuilderProtoConverterRegistry ([#18949](https://github.com/opensearch-project/OpenSearch/pull/18949))
1921
- Support system generated search pipeline. ([#19128](https://github.com/opensearch-project/OpenSearch/pull/19128))
22+
- Add `epoch_micros` date format ([#14669](https://github.com/opensearch-project/OpenSearch/issues/14669))
23+
- Grok processor supports capturing multiple values for same field name ([#18799](https://github.com/opensearch-project/OpenSearch/pull/18799))
24+
- Upgrade opensearch-protobufs dependency to 0.13.0 and update transport-grpc module compatibility ([#19007](https://github.com/opensearch-project/OpenSearch/issues/19007))
25+
- Add new extensible method to DocRequest to specify type ([#19313](https://github.com/opensearch-project/OpenSearch/pull/19313))
26+
- [Rule based auto-tagging] Add Rule based auto-tagging IT ([#18550](https://github.com/opensearch-project/OpenSearch/pull/18550))
27+
- Add all-active ingestion as docrep equivalent in pull-based ingestion ([#19316](https://github.com/opensearch-project/OpenSearch/pull/19316))
2028
- Added precomputation for rare terms aggregation ([##18978](https://github.com/opensearch-project/OpenSearch/pull/18978))
2129

2230
### Changed
31+
- Refactor `if-else` chains to use `Java 17 pattern matching switch expressions`(([#18965](https://github.com/opensearch-project/OpenSearch/pull/18965))
2332
- Add CompletionStage variants to methods in the Client Interface and default to ActionListener impl ([#18998](https://github.com/opensearch-project/OpenSearch/pull/18998))
2433
- IllegalArgumentException when scroll ID references a node not found in Cluster ([#19031](https://github.com/opensearch-project/OpenSearch/pull/19031))
2534
- Adding ScriptedAvg class to painless spi to allowlist usage from plugins ([#19006](https://github.com/opensearch-project/OpenSearch/pull/19006))
2635
- Replace centos:8 with almalinux:8 since centos docker images are deprecated ([#19154](https://github.com/opensearch-project/OpenSearch/pull/19154))
2736
- Add CompletionStage variants to IndicesAdminClient as an alternative to ActionListener ([#19161](https://github.com/opensearch-project/OpenSearch/pull/19161))
2837
- Remove cap on Java version used by forbidden APIs ([#19163](https://github.com/opensearch-project/OpenSearch/pull/19163))
2938
- Disable pruning for `doc_values` for the wildcard field mapper ([#18568](https://github.com/opensearch-project/OpenSearch/pull/18568))
39+
- Make all methods in Engine.Result public ([#19276](https://github.com/opensearch-project/OpenSearch/pull/19275))
40+
- Create and attach interclusterTest and yamlRestTest code coverage reports to gradle check task([#19165](https://github.com/opensearch-project/OpenSearch/pull/19165))
41+
- Optimized date histogram aggregations by preventing unnecessary object allocations in date rounding utils ([19088](https://github.com/opensearch-project/OpenSearch/pull/19088))
42+
- Optimize source conversion in gRPC search hits using zero-copy BytesRef ([#19280](https://github.com/opensearch-project/OpenSearch/pull/19280))
3043

3144
### Fixed
3245
- Fix unnecessary refreshes on update preparation failures ([#15261](https://github.com/opensearch-project/OpenSearch/issues/15261))
@@ -43,17 +56,20 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
4356
- Fix QueryPhaseResultConsumer incomplete callback loops ([#19231](https://github.com/opensearch-project/OpenSearch/pull/19231))
4457
- Fix the `scaled_float` precision issue ([#19188](https://github.com/opensearch-project/OpenSearch/pull/19188))
4558
- Fix Using an excessively large reindex slice can lead to a JVM OutOfMemoryError on coordinator.([#18964](https://github.com/opensearch-project/OpenSearch/pull/18964))
59+
- [Flaky Test] Fix flaky test in SecureReactorNetty4HttpServerTransportTests with reproducible seed ([#19327](https://github.com/opensearch-project/OpenSearch/pull/19327))
60+
- Remove unnecessary looping in field data cache clear ([#19116](https://github.com/opensearch-project/OpenSearch/pull/19116))
61+
4662

4763
### Dependencies
4864
- Bump `com.netflix.nebula.ospackage-base` from 12.0.0 to 12.1.0 ([#19019](https://github.com/opensearch-project/OpenSearch/pull/19019))
4965
- Bump `actions/checkout` from 4 to 5 ([#19023](https://github.com/opensearch-project/OpenSearch/pull/19023))
5066
- Bump `commons-cli:commons-cli` from 1.9.0 to 1.10.0 ([#19021](https://github.com/opensearch-project/OpenSearch/pull/19021))
5167
- Bump `org.jline:jline` from 3.30.4 to 3.30.5 ([#19013](https://github.com/opensearch-project/OpenSearch/pull/19013))
52-
- Bump `com.github.spotbugs:spotbugs-annotations` from 4.9.3 to 4.9.4 ([#19015](https://github.com/opensearch-project/OpenSearch/pull/19015))
68+
- Bump `com.github.spotbugs:spotbugs-annotations` from 4.9.3 to 4.9.5 ([#19015](https://github.com/opensearch-project/OpenSearch/pull/19015), [#19294](https://github.com/opensearch-project/OpenSearch/pull/19294))
5369
- Bump `com.azure:azure-storage-common` from 12.29.1 to 12.30.2 ([#19016](https://github.com/opensearch-project/OpenSearch/pull/19016), [#19145](https://github.com/opensearch-project/OpenSearch/pull/19145))
5470
- Update OpenTelemetry to 1.53.0 and OpenTelemetry SemConv to 1.34.0 ([#19068](https://github.com/opensearch-project/OpenSearch/pull/19068))
5571
- Bump `1password/load-secrets-action` from 2 to 3 ([#19100](https://github.com/opensearch-project/OpenSearch/pull/19100))
56-
- Bump `com.nimbusds:nimbus-jose-jwt` from 10.3 to 10.4.2 ([#19099](https://github.com/opensearch-project/OpenSearch/pull/19099), [#19101](https://github.com/opensearch-project/OpenSearch/pull/19101))
72+
- Bump `com.nimbusds:nimbus-jose-jwt` from 10.3 to 10.5 ([#19099](https://github.com/opensearch-project/OpenSearch/pull/19099), [#19101](https://github.com/opensearch-project/OpenSearch/pull/19101), [#19254](https://github.com/opensearch-project/OpenSearch/pull/19254))
5773
- Bump netty from 4.1.121.Final to 4.1.125.Final ([#19103](https://github.com/opensearch-project/OpenSearch/pull/19103)) ([#19269](https://github.com/opensearch-project/OpenSearch/pull/19269)
5874
- Bump Google Cloud Storage SDK from 1.113.1 to 2.55.0 ([#18922](https://github.com/opensearch-project/OpenSearch/pull/18922))
5975
- Bump `com.google.auth:google-auth-library-oauth2-http` from 1.37.1 to 1.38.0 ([#19144](https://github.com/opensearch-project/OpenSearch/pull/19144))
@@ -74,6 +90,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
7490
- Bump `com.maxmind.geoip2:geoip2` from 4.3.1 to 4.4.0 ([#19205](https://github.com/opensearch-project/OpenSearch/pull/19205))
7591
- Bump `org.jboss.xnio:xnio-nio` from 3.8.16.Final to 3.8.17.Final ([#19252](https://github.com/opensearch-project/OpenSearch/pull/19252))
7692
- Bump `actions/setup-java` from 4 to 5 ([#19143](https://github.com/opensearch-project/OpenSearch/pull/19143))
93+
- Bump `com.google.code.gson:gson` from 2.13.1 to 2.13.2 ([#19290](https://github.com/opensearch-project/OpenSearch/pull/19290)) ([#19293](https://github.com/opensearch-project/OpenSearch/pull/19293))
94+
- Bump `actions/stale` from 9 to 10 ([#19292](https://github.com/opensearch-project/OpenSearch/pull/19292))
95+
- Bump `com.nimbusds:oauth2-oidc-sdk` from 11.25 to 11.28 ([#19291](https://github.com/opensearch-project/OpenSearch/pull/19291))
96+
- Bump `log4j2` from 2.21.0 to 2.25.1 ([#19184](https://github.com/opensearch-project/OpenSearch/pull/19184))
97+
- Bump Apache Lucene from 10.2.2 to 10.3.0 ([#19296](https://github.com/opensearch-project/OpenSearch/pull/19296))
98+
- Add com.google.code.gson:gson to the gradle version catalog ([#19328](https://github.com/opensearch-project/OpenSearch/pull/19328))
7799

78100
### Deprecated
79101

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
<img src="https://opensearch.org/assets/img/opensearch-logo-themed.svg" height="64px">
33
</a>
44

5+
[![License](https://img.shields.io/badge/license-Apache%20v2-blue.svg)](https://github.com/opensearch-project/OpenSearch/blob/main/LICENSE.txt)
56
[![LFX Health Score](https://insights.production.lfx.dev/api/badge/health-score?project=opensearch-foundation)](https://insights.linuxfoundation.org/project/opensearch-foundation)
67
[![LFX Active Contributors](https://insights.production.lfx.dev/api/badge/active-contributors?project=opensearch-foundation&repos=https://github.com/opensearch-project/OpenSearch)](https://insights.linuxfoundation.org/project/opensearch-foundation/repository/opensearch-project-opensearch)
78
[![Code Coverage](https://codecov.io/gh/opensearch-project/OpenSearch/branch/main/graph/badge.svg)](https://codecov.io/gh/opensearch-project/OpenSearch)
89
![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/opensearch-project/OpenSearch?sort=semver)
10+
[![Linkedin](https://img.shields.io/badge/Follow-Linkedin-blue)](https://www.linkedin.com/company/opensearch-project)
911

1012
- [Welcome!](#welcome)
1113
- [Project Resources](#project-resources)

gradle/code-coverage.gradle

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,19 @@ allprojects {
5252
executionDataFiles.add("$buildDir/jacoco/javaRestTest.exec")
5353
sourceSetsList.add(sourceSets.javaRestTest)
5454
}
55+
if (tasks.findByName('yamlRestTest')) {
56+
executionDataFiles.add("$buildDir/jacoco/yamlRestTest.exec")
57+
sourceSetsList.add(sourceSets.yamlRestTest)
58+
}
5559
if (!executionDataFiles.isEmpty()) {
5660
executionData.setFrom(files(executionDataFiles).filter { it.exists() })
5761
sourceSets(*sourceSetsList)
5862
}
5963
onlyIf {
6064
file("$buildDir/jacoco/test.exec").exists() ||
6165
file("$buildDir/jacoco/internalClusterTest.exec").exists() ||
62-
file("$buildDir/jacoco/javaRestTest.exec").exists()
66+
file("$buildDir/jacoco/javaRestTest.exec").exists() ||
67+
file("$buildDir/jacoco/yamlRestTest.exec").exists()
6368
}
6469
}
6570
}
@@ -71,17 +76,25 @@ if (System.getProperty("tests.coverage")) {
7176
testCodeCoverageReport(JacocoCoverageReport) {
7277
testSuiteName = "test"
7378
}
79+
testCodeCoverageReportInternalClusterTest(JacocoCoverageReport) {
80+
testSuiteName = "internalClusterTest"
81+
}
7482
testCodeCoverageReportJavaRestTest(JacocoCoverageReport) {
7583
testSuiteName = "javaRestTest"
7684
}
85+
testCodeCoverageReportYamlRestTest(JacocoCoverageReport) {
86+
testSuiteName = "yamlRestTest"
87+
}
7788
}
7889
}
7990

8091
// Attach code coverage report task to Gradle check task
8192
project.getTasks().named(JavaBasePlugin.CHECK_TASK_NAME).configure {
8293
dependsOn(
8394
tasks.named('testCodeCoverageReport', JacocoReport),
84-
tasks.named('testCodeCoverageReportJavaRestTest', JacocoReport)
95+
tasks.named('testCodeCoverageReportInternalClusterTest', JacocoReport),
96+
tasks.named('testCodeCoverageReportJavaRestTest', JacocoReport),
97+
tasks.named('testCodeCoverageReportYamlRestTest', JacocoReport)
8598
)
8699
}
87100
}

gradle/libs.versions.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[versions]
22
opensearch = "3.3.0"
3-
lucene = "10.2.2"
3+
lucene = "10.3.0"
44

55
bundled_jdk_vendor = "adoptium"
66
bundled_jdk = "24.0.2+12"
@@ -13,14 +13,18 @@ jackson_databind = "2.18.2"
1313
snakeyaml = "2.1"
1414
icu4j = "77.1"
1515
supercsv = "2.4.0"
16-
log4j = "2.21.0"
16+
log4j = "2.25.1"
17+
error_prone_annotations = "2.41.0"
18+
spotbugs_annotations = "4.9.4"
1719
slf4j = "2.0.17"
1820
asm = "9.7"
1921
jettison = "1.5.4"
2022
woodstox = "6.4.0"
2123
kotlin = "1.7.10"
2224
antlr4 = "4.13.1"
2325
guava = "33.2.1-jre"
26+
gson = "2.13.2"
27+
opensearchprotobufs = "0.13.0"
2428
protobuf = "3.25.8"
2529
jakarta_annotation = "1.3.5"
2630
google_http_client = "1.44.1"
@@ -106,6 +110,7 @@ bouncycastle-tls = { group = "org.bouncycastle", name = "bctls-fips", version.re
106110
bouncycastle-pkix = { group = "org.bouncycastle", name = "bcpkix-fips", version.ref = "bouncycastle_pkix"}
107111
bouncycastle-pg = { group = "org.bouncycastle", name = "bcpg-fips", version.ref = "bouncycastle_pg"}
108112
bouncycastle-util = { group = "org.bouncycastle", name = "bcutil-fips", version.ref = "bouncycastle_util"}
113+
gson = { group = "com.google.code.gson", name = "gson", version.ref = "gson" }
109114
hamcrest = { group = "org.hamcrest", name = "hamcrest", version.ref = "hamcrest" }
110115
hdrhistogram = { group = "org.hdrhistogram", name = "HdrHistogram", version.ref = "hdrhistogram" }
111116
jackson-annotation = { group = "com.fasterxml.jackson.core", name = "jackson-annotations", version.ref = "jackson" }

libs/common/src/main/java/org/opensearch/common/Numbers.java

Lines changed: 44 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -83,44 +83,60 @@ public static boolean isValidDouble(double value) {
8383
* stored value cannot be converted to a long that stores the exact same
8484
* value. */
8585
public static long toLongExact(Number n) {
86-
if (n instanceof Byte || n instanceof Short || n instanceof Integer || n instanceof Long) {
87-
return n.longValue();
88-
} else if (n instanceof Float || n instanceof Double) {
89-
double d = n.doubleValue();
90-
if (d != Math.round(d)) {
91-
throw new IllegalArgumentException(n + " is not an integer value");
86+
return switch (n) {
87+
case Byte b -> b.longValue();
88+
case Short s -> s.longValue();
89+
case Integer i -> i.longValue();
90+
case Long l -> l;
91+
case Float f -> {
92+
double d = f.doubleValue();
93+
if (d != Math.round(d)) {
94+
throw new IllegalArgumentException(f + " is not an integer value");
95+
}
96+
yield f.longValue();
9297
}
93-
return n.longValue();
94-
} else if (n instanceof BigDecimal) {
95-
return ((BigDecimal) n).toBigIntegerExact().longValueExact();
96-
} else if (n instanceof BigInteger) {
97-
return ((BigInteger) n).longValueExact();
98-
} else {
99-
throw new IllegalArgumentException(
98+
case Double d -> {
99+
if (d != Math.round(d)) {
100+
throw new IllegalArgumentException(d + " is not an integer value");
101+
}
102+
yield d.longValue();
103+
}
104+
case BigDecimal bd -> bd.toBigIntegerExact().longValueExact();
105+
case BigInteger bi -> bi.longValueExact();
106+
default -> throw new IllegalArgumentException(
100107
"Cannot check whether [" + n + "] of class [" + n.getClass().getName() + "] is actually a long"
101108
);
102-
}
109+
};
103110
}
104111

105112
/** Return the {@link BigInteger} that {@code n} stores, or throws an exception if the
106113
* stored value cannot be converted to a {@link BigInteger} that stores the exact same
107114
* value. */
108115
public static BigInteger toBigIntegerExact(Number n) {
109-
if (n instanceof Byte || n instanceof Short || n instanceof Integer || n instanceof Long) {
110-
return BigInteger.valueOf(n.longValue());
111-
} else if (n instanceof Float || n instanceof Double) {
112-
double d = n.doubleValue();
113-
if (d != Math.round(d)) {
114-
throw new IllegalArgumentException(n + " is not an integer value");
116+
return switch (n) {
117+
case Byte b -> BigInteger.valueOf(b.longValue());
118+
case Short s -> BigInteger.valueOf(s.longValue());
119+
case Integer i -> BigInteger.valueOf(i.longValue());
120+
case Long l -> BigInteger.valueOf(l.longValue());
121+
case Float f -> {
122+
double d = f.doubleValue();
123+
if (d != Math.round(d)) {
124+
throw new IllegalArgumentException(f + " is not an integer value");
125+
}
126+
yield BigInteger.valueOf(f.longValue());
115127
}
116-
return BigInteger.valueOf(n.longValue());
117-
} else if (n instanceof BigDecimal) {
118-
return ((BigDecimal) n).toBigIntegerExact();
119-
} else if (n instanceof BigInteger) {
120-
return ((BigInteger) n);
121-
} else {
122-
throw new IllegalArgumentException("Cannot convert [" + n + "] of class [" + n.getClass().getName() + "] to a BigInteger");
123-
}
128+
case Double d -> {
129+
if (d != Math.round(d)) {
130+
throw new IllegalArgumentException(d + " is not an integer value");
131+
}
132+
yield BigInteger.valueOf(d.longValue());
133+
}
134+
case BigDecimal bd -> bd.toBigIntegerExact();
135+
case BigInteger bi -> bi;
136+
default -> throw new IllegalArgumentException(
137+
"Cannot convert [" + n + "] of class [" + n.getClass().getName() + "] to a BigInteger"
138+
);
139+
};
124140
}
125141

126142
/** Return the unsigned long (as {@link BigInteger}) that {@code n} stores, or throws an exception if the

libs/core/licenses/log4j-api-2.21.0.jar.sha1

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
c7acbbd6f110cd1457c628da46245e355b1ee57a

libs/core/licenses/lucene-core-10.2.2.jar.sha1

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
52f4ab3e4f5a80d52183842b7c81513f89f09f91

0 commit comments

Comments
 (0)