Skip to content

Commit 3f9f021

Browse files
committed
Merge branch 'main' into fips_build_tooling2
2 parents aafca9f + 753c135 commit 3f9f021

File tree

93 files changed

+2639
-572
lines changed

Some content is hidden

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

93 files changed

+2639
-572
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1212
- Add a mapper for context aware segments grouping criteria ([#19233](https://github.com/opensearch-project/OpenSearch/pull/19233))
1313
- Return full error for GRPC error response ([#19568](https://github.com/opensearch-project/OpenSearch/pull/19568))
1414
- Add pluggable gRPC interceptors with explicit ordering([#19005](https://github.com/opensearch-project/OpenSearch/pull/19005))
15+
- Add BindableServices extension point to transport-grpc-spi ([#19304](https://github.com/opensearch-project/OpenSearch/pull/19304))
1516
- Add metrics for the merged segment warmer feature ([#18929](https://github.com/opensearch-project/OpenSearch/pull/18929))
1617
- Add pointer based lag metric in pull-based ingestion ([#19635](https://github.com/opensearch-project/OpenSearch/pull/19635))
1718
- Introduced internal API for retrieving metadata about requested indices from transport actions ([#18523](https://github.com/opensearch-project/OpenSearch/pull/18523))
19+
- Add cluster defaults for merge autoThrottle, maxMergeThreads, and maxMergeCount; Add segment size filter to the merged segment warmer ([#19629](https://github.com/opensearch-project/OpenSearch/pull/19629))
1820
- Add build-tooling to run in FIPS environment ([#18921](https://github.com/opensearch-project/OpenSearch/pull/18921))
1921

2022
### Changed
@@ -27,15 +29,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
2729
- Wrap checked exceptions in painless.DefBootstrap to support JDK-25 ([#19706](https://github.com/opensearch-project/OpenSearch/pull/19706))
2830
- Refactor the ThreadPoolStats.Stats class to use the Builder pattern instead of constructors ([#19317](https://github.com/opensearch-project/OpenSearch/pull/19317))
2931
- Refactor the IndexingStats.Stats class to use the Builder pattern instead of constructors ([#19306](https://github.com/opensearch-project/OpenSearch/pull/19306))
30-
32+
- Remove FeatureFlag.MERGED_SEGMENT_WARMER_EXPERIMENTAL_FLAG. ([#19715](https://github.com/opensearch-project/OpenSearch/pull/19715))
33+
-
3134
### Fixed
3235
- Fix Allocation and Rebalance Constraints of WeightFunction are incorrectly reset ([#19012](https://github.com/opensearch-project/OpenSearch/pull/19012))
3336
- Fix flaky test FieldDataLoadingIT.testIndicesFieldDataCacheSizeSetting ([#19571](https://github.com/opensearch-project/OpenSearch/pull/19571))
37+
- Fix case-insensitive wildcard + aggregation query crash ([#19489](https://github.com/opensearch-project/OpenSearch/pull/19489))
3438
- Avoid primary shard failure caused by merged segment warmer exceptions ([#19436](https://github.com/opensearch-project/OpenSearch/pull/19436))
3539
- Fix pull-based ingestion out-of-bounds offset scenarios and remove persisted offsets ([#19607](https://github.com/opensearch-project/OpenSearch/pull/19607))
3640
- Fix issue with updating core with a patch number other than 0 ([#19377](https://github.com/opensearch-project/OpenSearch/pull/19377))
3741
- [Java Agent] Allow JRT protocol URLs in protection domain extraction ([#19683](https://github.com/opensearch-project/OpenSearch/pull/19683))
3842
- Fix potential concurrent modification exception when updating allocation filters ([#19701])(https://github.com/opensearch-project/OpenSearch/pull/19701))
43+
- Fix file-based ingestion consumer to handle start point beyond max line number([#19757])(https://github.com/opensearch-project/OpenSearch/pull/19757))
3944

4045
### Dependencies
4146
- Update to Gradle 9.1 ([#19575](https://github.com/opensearch-project/OpenSearch/pull/19575))

buildSrc/build.gradle

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,14 @@ dependencies {
133133
integTestImplementation('org.spockframework:spock-core:2.4-M6-groovy-4.0') {
134134
exclude module: "groovy"
135135
}
136+
// Integration with JUnit 4 features for Spock 2+ (which internally uses JUnit Platform -
137+
// part of JUnit 5) - https://spockframework.org/spock/docs/2.4-M6/modules.html
138+
integTestImplementation('org.spockframework:spock-junit4:2.4-M6-groovy-4.0') {
139+
exclude module: "groovy"
140+
}
141+
integTestImplementation(platform("org.junit:junit-bom:${props.getProperty('junit5')}"))
142+
integTestRuntimeOnly("org.junit.platform:junit-platform-launcher")
143+
integTestRuntimeOnly("org.junit.vintage:junit-vintage-engine")
136144
}
137145

138146
configurations.all {
@@ -253,6 +261,7 @@ if (project != rootProject) {
253261
}
254262

255263
tasks.register("integTest", Test) {
264+
useJUnitPlatform()
256265
inputs.dir(file("src/testKit")).withPropertyName("testkit dir").withPathSensitivity(PathSensitivity.RELATIVE)
257266
systemProperty 'test.version_under_test', version
258267
onlyIf { org.opensearch.gradle.info.BuildParams.isInFipsJvm() == false }

buildSrc/src/integTest/groovy/org/opensearch/gradle/DistributionDownloadPluginFuncTest.groovy

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ class DistributionDownloadPluginFuncTest extends AbstractGradleFuncTest {
5656
where:
5757
version | platform | distType
5858
VersionProperties.getOpenSearch() | OpenSearchDistribution.Platform.LINUX | "current"
59-
"8.1.0-SNAPSHOT" | OpenSearchDistribution.Platform.LINUX | "bwc"
60-
"7.0.0" | OpenSearchDistribution.Platform.WINDOWS | "released"
59+
"2.19.0-SNAPSHOT" | OpenSearchDistribution.Platform.LINUX | "bwc"
60+
"3.3.0" | OpenSearchDistribution.Platform.WINDOWS | "released"
6161
}
6262

6363

@@ -72,7 +72,8 @@ class DistributionDownloadPluginFuncTest extends AbstractGradleFuncTest {
7272
"""
7373

7474
when:
75-
def runner = gradleRunner('clean', 'setupDistro', '-i')
75+
def customGradleUserHome = testProjectDir.newFolder().absolutePath;
76+
def runner = gradleRunner('clean', 'setupDistro', '-i', '-g', customGradleUserHome)
7677
def result = withMockedDistributionDownload(version, platform, runner) {
7778
// initial run
7879
build()
@@ -82,7 +83,8 @@ class DistributionDownloadPluginFuncTest extends AbstractGradleFuncTest {
8283

8384
then:
8485
result.task(":setupDistro").outcome == TaskOutcome.SUCCESS
85-
assertOutputContains(result.output, "Skipping ${SymbolicLinkPreservingUntarTransform.class.simpleName}")
86+
result.output.count("Unpacking opensearch-${version}-linux-x64.tar.gz " +
87+
"using SymbolicLinkPreservingUntarTransform.") == 0
8688
}
8789

8890
def "transforms are reused across projects"() {
@@ -91,6 +93,7 @@ class DistributionDownloadPluginFuncTest extends AbstractGradleFuncTest {
9193
def platform = OpenSearchDistribution.Platform.LINUX
9294

9395
3.times {
96+
testProjectDir.newFolder("sub-$it")
9497
settingsFile << """
9598
include ':sub-$it'
9699
"""

buildSrc/src/integTest/groovy/org/opensearch/gradle/JdkDownloadPluginFuncTest.groovy

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ class JdkDownloadPluginFuncTest extends AbstractGradleFuncTest {
108108
def mockRepoUrl = urlPath(jdkVendor, jdkVersion, platform)
109109
def mockedContent = filebytes(jdkVendor, platform)
110110
3.times {
111+
testProjectDir.newFolder("sub-$it")
111112
settingsFile << """
112113
include ':sub-$it'
113114
"""
@@ -193,7 +194,7 @@ class JdkDownloadPluginFuncTest extends AbstractGradleFuncTest {
193194
}
194195

195196
then:
196-
assertOutputContains(result.output, "Skipping $transformType")
197+
result.output.count("Unpacking ${platform}-12.0.2-x64.tar.gz using ${transformType}.") == 0
197198

198199
where:
199200
platform | transformType
@@ -246,6 +247,7 @@ class JdkDownloadPluginFuncTest extends AbstractGradleFuncTest {
246247
p.repositories.all { repo ->
247248
if(repo.name == "jdk_repo_${jdkVendor}_${jdkVersion}") {
248249
repo.setUrl('${server.baseUrl()}')
250+
repo.setAllowInsecureProtocol(true)
249251
}
250252
}
251253
}"""

buildSrc/src/integTest/groovy/org/opensearch/gradle/internal/InternalDistributionArchiveSetupPluginFuncTest.groovy

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ class InternalDistributionArchiveSetupPluginFuncTest extends AbstractGradleFuncT
9898
given:
9999
file('someFile.txt') << "some content"
100100

101+
testProjectDir.newFolder("consumer")
102+
testProjectDir.newFolder("producer-tar")
103+
101104
settingsFile << """
102105
include ':consumer'
103106
include ':producer-tar'

buildSrc/src/integTest/groovy/org/opensearch/gradle/internal/InternalDistributionDownloadPluginFuncTest.groovy

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ class InternalDistributionDownloadPluginFuncTest extends AbstractGradleFuncTest
122122
internalBuild()
123123
bwcMinorProjectSetup()
124124
buildFile << """
125+
import org.opensearch.gradle.JavaPackageType
126+
125127
apply plugin: 'opensearch.internal-distribution-download'
126128
127129
opensearch_distributions {
@@ -130,7 +132,7 @@ class InternalDistributionDownloadPluginFuncTest extends AbstractGradleFuncTest
130132
type = "archive"
131133
platform = "linux"
132134
architecture = Architecture.current();
133-
bundledJdk = false
135+
bundledJdk = JavaPackageType.NONE
134136
}
135137
}
136138
tasks.register("createExtractedTestDistro") {

buildSrc/src/integTest/resources/org/opensearch/gradle/internal/fake_git/remote/distribution/archives/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ subprojects {
3232
apply plugin:'base'
3333

3434
tasks.register('tar', Tar) {
35-
from('.')
35+
from('build.gradle')
3636
destinationDirectory.set(file('build/distributions'))
3737
archiveBaseName.set("opensearch")
3838
archiveVersion.set("8.0.1-SNAPSHOT")

buildSrc/src/testKit/testingConventions/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ allprojects {
2121
mavenCentral()
2222
}
2323
dependencies {
24-
testImplementation "junit:junit:4.13.2"
24+
testImplementation "junit:junit:${versions.junit}"
2525
}
2626

2727
ext.licenseFile = file("$buildDir/dummy/license")

gradle/libs.versions.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ picocli = "4.7.7"
7575
# test dependencies
7676
randomizedrunner = "2.7.1"
7777
junit = "4.13.2"
78+
junit5 = "6.0.0"
7879
hamcrest = "2.1"
7980
mockito = "5.16.1"
8081
objenesis = "3.3"

modules/transport-grpc/spi/README.md

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ The `transport-grpc-spi` module enables plugin developers to:
99
- Extend gRPC protocol buffer handling
1010
- Register custom query types that can be processed via gRPC
1111
- Register gRPC interceptors with explicit ordering
12+
- Register `BindableService` implementation to the gRPC transport
1213

1314
## Key Components
1415

@@ -47,6 +48,10 @@ public interface GrpcInterceptorProvider {
4748
}
4849
```
4950

51+
### GrpcServiceFactory
52+
53+
Interface for providing a `BindableService` factory to be registered on the grpc transport.
54+
5055
## Usage for Plugin Developers
5156

5257
### 1. Add Dependency
@@ -63,7 +68,7 @@ dependencies {
6368

6469
### 2. Declare Extension in build.gradle
6570

66-
In your `build.gradle`, declare that your plugin extends `transport-grpc`. This automatically adds the `extended.plugins=transport-grpc` entry to the auto-generated `plugin-descriptor.properties` file: :
71+
In your `build.gradle`, declare that your plugin extends `transport-grpc`. This automatically adds the `extended.plugins=transport-grpc` entry to the auto-generated `plugin-descriptor.properties` file:
6772

6873
```groovy
6974
opensearchplugin {
@@ -81,20 +86,26 @@ opensearchplugin {
8186

8287
Create a service file denoting your plugin's implementation of a service interface.
8388

84-
For QueryBuilderProtoConverter implementations:
89+
For `QueryBuilderProtoConverter` implementations:
8590
`src/main/resources/META-INF/services/org.opensearch.transport.grpc.spi.QueryBuilderProtoConverter`:
8691

8792
```
8893
org.opensearch.mypackage.MyCustomQueryConverter
8994
```
9095

91-
For `GrpcInterceptorProvider` implementations: `src/main/resources/META-INF/services/org.opensearch.transport.grpc.spi.GrpcInterceptorProvider`:
96+
For `GrpcInterceptorProvider` implementations:
97+
`src/main/resources/META-INF/services/org.opensearch.transport.grpc.spi.GrpcInterceptorProvider`:
9298

9399
```
94100
org.opensearch.mypackage.SampleInterceptorProvider
95101
```
96102

103+
For `GrpcServiceFactory` implementations:
104+
`src/main/resources/META-INF/services/org.opensearch.transport.grpc.spi.GrpcServiceFactory`:
97105

106+
```
107+
org.opensearch.mypackage.MyCustomGrpcServiceFactory
108+
```
98109

99110
## QueryBuilderProtoConverter
100111
### 1. Implement Custom Query Converter
@@ -383,3 +394,25 @@ Each interceptor must have a unique order value. If duplicate order values are d
383394
IllegalArgumentException: Multiple gRPC interceptors have the same order value: 10.
384395
Each interceptor must have a unique order value.
385396
```
397+
398+
## GrpcServiceFactory
399+
400+
### 1. Implement Custom Query Converter
401+
402+
Several node resources are exposed to a `GrpcServiceFactory` for use within services such as client, settings, and thread pools.
403+
A plugin's `GrpcServiceFactory` implementation will be discovered through the SPI registration file and registered on the gRPC transport.
404+
405+
```java
406+
public static class MockServiceProvider implements GrpcServiceFactory {
407+
408+
@Override
409+
public String plugin() {
410+
return "MockExtendingPlugin";
411+
}
412+
413+
@Override
414+
public List<BindableService> build() {
415+
return List.of(new MockChannelzService());
416+
}
417+
}
418+
```

0 commit comments

Comments
 (0)