Skip to content

Commit a931a05

Browse files
author
Swetha Guptha
committed
Merge remote-tracking branch 'origin/main' into explicitly-set-concrete-nodes-flag-in-secure-setting-action
2 parents 3811ea6 + 3a1b6d1 commit a931a05

File tree

27 files changed

+360
-25
lines changed

27 files changed

+360
-25
lines changed

.ci/bwcVersions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,5 @@ BWC_VERSION:
3838
- "2.16.0"
3939
- "2.16.1"
4040
- "2.17.0"
41+
- "2.17.1"
4142
- "2.18.0"

.github/workflows/delete_backport_branch.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,16 @@ on:
77
jobs:
88
delete-branch:
99
runs-on: ubuntu-latest
10+
permissions:
11+
contents: write
1012
if: startsWith(github.event.pull_request.head.ref,'backport/')
1113
steps:
1214
- name: Delete merged branch
13-
uses: SvanBoxel/delete-merged-branch@main
14-
env:
15-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15+
uses: actions/github-script@v5
16+
with:
17+
script: |
18+
github.rest.git.deleteRef({
19+
owner: context.repo.owner,
20+
repo: context.repo.repo,
21+
ref: `heads/${context.payload.pull_request.head.ref}`,
22+
})

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
88
- MultiTermQueries in keyword fields now default to `indexed` approach and gated behind cluster setting ([#15637](https://github.com/opensearch-project/OpenSearch/pull/15637))
99
- [Workload Management] QueryGroup resource cancellation framework changes ([#15651](https://github.com/opensearch-project/OpenSearch/pull/15651))
1010
- Fallback to Remote cluster-state on Term-Version check mismatch - ([#15424](https://github.com/opensearch-project/OpenSearch/pull/15424))
11+
- Implement WithFieldName interface in ValuesSourceAggregationBuilder & FieldSortBuilder ([#15916](https://github.com/opensearch-project/OpenSearch/pull/15916))
1112

1213
### Dependencies
1314
- Bump `com.azure:azure-identity` from 1.13.0 to 1.13.2 ([#15578](https://github.com/opensearch-project/OpenSearch/pull/15578))
1415
- Bump `protobuf` from 3.22.3 to 3.25.4 ([#15684](https://github.com/opensearch-project/OpenSearch/pull/15684))
1516
- Bump `org.apache.logging.log4j:log4j-core` from 2.23.1 to 2.24.0 ([#15858](https://github.com/opensearch-project/OpenSearch/pull/15858))
1617
- Bump `peter-evans/create-pull-request` from 6 to 7 ([#15863](https://github.com/opensearch-project/OpenSearch/pull/15863))
1718
- Bump `com.nimbusds:oauth2-oidc-sdk` from 11.9.1 to 11.19.1 ([#15862](https://github.com/opensearch-project/OpenSearch/pull/15862))
19+
- Bump `com.microsoft.azure:msal4j` from 1.17.0 to 1.17.1 ([#15945](https://github.com/opensearch-project/OpenSearch/pull/15945))
1820
- Bump `ch.qos.logback:logback-core` from 1.5.6 to 1.5.8 ([#15946](https://github.com/opensearch-project/OpenSearch/pull/15946))
1921

2022
### Changed
@@ -27,6 +29,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
2729
### Fixed
2830
- Fix wildcard query containing escaped character ([#15737](https://github.com/opensearch-project/OpenSearch/pull/15737))
2931
- Fix case-insensitive query on wildcard field ([#15882](https://github.com/opensearch-project/OpenSearch/pull/15882))
32+
- Add validation for the search backpressure cancellation settings ([#15501](https://github.com/opensearch-project/OpenSearch/pull/15501))
33+
3034
### Security
3135

3236
[Unreleased 2.x]: https://github.com/opensearch-project/OpenSearch/compare/2.17...2.x

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +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.17.0 Open Issues](https://img.shields.io/github/issues/opensearch-project/OpenSearch/v2.17.0)](https://github.com/opensearch-project/OpenSearch/issues?q=is%3Aissue+is%3Aopen+label%3A"v2.17.0")
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.1 Open Issues](https://img.shields.io/github/issues/opensearch-project/OpenSearch/v2.17.1)](https://github.com/opensearch-project/OpenSearch/issues?q=is%3Aissue+is%3Aopen+label%3A"v2.17.1")
1112
[![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")
1213
[![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)
1314
[![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)

libs/core/src/main/java/org/opensearch/Version.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ public class Version implements Comparable<Version>, ToXContentFragment {
109109
public static final Version V_2_16_0 = new Version(2160099, org.apache.lucene.util.Version.LUCENE_9_11_1);
110110
public static final Version V_2_16_1 = new Version(2160199, org.apache.lucene.util.Version.LUCENE_9_11_1);
111111
public static final Version V_2_17_0 = new Version(2170099, org.apache.lucene.util.Version.LUCENE_9_11_1);
112+
public static final Version V_2_17_1 = new Version(2170199, org.apache.lucene.util.Version.LUCENE_9_11_1);
112113
public static final Version V_2_18_0 = new Version(2180099, org.apache.lucene.util.Version.LUCENE_9_11_1);
113114
public static final Version V_3_0_0 = new Version(3000099, org.apache.lucene.util.Version.LUCENE_9_12_0);
114115
public static final Version CURRENT = V_3_0_0;

plugins/repository-azure/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ dependencies {
6161
// Start of transitive dependencies for azure-identity
6262
api 'com.microsoft.azure:msal4j-persistence-extension:1.3.0'
6363
api "net.java.dev.jna:jna-platform:${versions.jna}"
64-
api 'com.microsoft.azure:msal4j:1.17.0'
64+
api 'com.microsoft.azure:msal4j:1.17.1'
6565
api 'com.nimbusds:oauth2-oidc-sdk:11.19.1'
6666
api 'com.nimbusds:nimbus-jose-jwt:9.40'
6767
api 'com.nimbusds:content-type:2.3'

plugins/repository-azure/licenses/msal4j-1.17.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+
4eb31a9919d9b103c548af7e37e6f9d9f6e46dbc

plugins/transport-reactor-netty4/src/javaRestTest/java/org/opensearch/rest/ReactorNetty4StreamingStressIT.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
package org.opensearch.rest;
1010

11+
import org.apache.hc.core5.http.ConnectionClosedException;
1112
import org.opensearch.client.Request;
1213
import org.opensearch.client.Response;
1314
import org.opensearch.client.StreamingRequest;
@@ -75,7 +76,7 @@ public void testCloseClientStreamingRequest() throws Exception {
7576
}
7677
})
7778
.then(() -> scheduler.advanceTimeBy(delay))
78-
.expectErrorMatches(t -> t instanceof InterruptedIOException)
79+
.expectErrorMatches(t -> t instanceof InterruptedIOException || t instanceof ConnectionClosedException)
7980
.verify();
8081
}
8182
}

rest-api-spec/src/main/resources/rest-api-spec/test/cluster.put_settings/10_basic.yml

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,116 @@
9898
- match: {error.root_cause.0.type: "illegal_argument_exception"}
9999
- match: { error.root_cause.0.reason: "Invalid SearchBackpressureMode: monitor-only" }
100100
- match: { status: 400 }
101+
102+
103+
---
104+
"Test setting search backpressure cancellation settings":
105+
- skip:
106+
version: "- 2.99.99"
107+
reason: "Fixed in 3.0.0"
108+
109+
- do:
110+
cluster.put_settings:
111+
body:
112+
transient:
113+
search_backpressure.search_task.cancellation_burst: 11
114+
- is_true: acknowledged
115+
116+
- do:
117+
cluster.get_settings:
118+
flat_settings: false
119+
- match: {transient.search_backpressure.search_task.cancellation_burst: "11"}
120+
121+
- do:
122+
cluster.put_settings:
123+
body:
124+
transient:
125+
search_backpressure.search_task.cancellation_rate: 0.1
126+
- is_true: acknowledged
127+
128+
- do:
129+
cluster.get_settings:
130+
flat_settings: false
131+
- match: {transient.search_backpressure.search_task.cancellation_rate: "0.1"}
132+
133+
- do:
134+
cluster.put_settings:
135+
body:
136+
transient:
137+
search_backpressure.search_task.cancellation_ratio: 0.2
138+
- is_true: acknowledged
139+
140+
- do:
141+
cluster.get_settings:
142+
flat_settings: false
143+
- match: {transient.search_backpressure.search_task.cancellation_ratio: "0.2"}
144+
145+
- do:
146+
cluster.put_settings:
147+
body:
148+
transient:
149+
search_backpressure.search_shard_task.cancellation_burst: 12
150+
- is_true: acknowledged
151+
152+
- do:
153+
cluster.get_settings:
154+
flat_settings: false
155+
- match: {transient.search_backpressure.search_shard_task.cancellation_burst: "12"}
156+
157+
- do:
158+
cluster.put_settings:
159+
body:
160+
transient:
161+
search_backpressure.search_shard_task.cancellation_rate: 0.3
162+
- is_true: acknowledged
163+
164+
- do:
165+
cluster.get_settings:
166+
flat_settings: false
167+
- match: {transient.search_backpressure.search_shard_task.cancellation_rate: "0.3"}
168+
169+
- do:
170+
cluster.put_settings:
171+
body:
172+
transient:
173+
search_backpressure.search_shard_task.cancellation_ratio: 0.4
174+
- is_true: acknowledged
175+
176+
- do:
177+
cluster.get_settings:
178+
flat_settings: false
179+
- match: {transient.search_backpressure.search_shard_task.cancellation_ratio: "0.4"}
180+
181+
---
182+
"Test setting invalid search backpressure cancellation_rate and cancellation_ratio":
183+
- skip:
184+
version: "- 2.99.99"
185+
reason: "Fixed in 3.0.0"
186+
187+
- do:
188+
catch: /search_backpressure.search_task.cancellation_rate must be > 0/
189+
cluster.put_settings:
190+
body:
191+
transient:
192+
search_backpressure.search_task.cancellation_rate: 0.0
193+
194+
- do:
195+
catch: /search_backpressure.search_task.cancellation_ratio must be > 0/
196+
cluster.put_settings:
197+
body:
198+
transient:
199+
search_backpressure.search_task.cancellation_ratio: 0.0
200+
201+
- do:
202+
catch: /search_backpressure.search_shard_task.cancellation_rate must be > 0/
203+
cluster.put_settings:
204+
body:
205+
transient:
206+
search_backpressure.search_shard_task.cancellation_rate: 0.0
207+
208+
- do:
209+
catch: /search_backpressure.search_shard_task.cancellation_ratio must be > 0/
210+
cluster.put_settings:
211+
body:
212+
transient:
213+
search_backpressure.search_shard_task.cancellation_ratio: 0.0

server/src/internalClusterTest/java/org/opensearch/gateway/remote/RemoteStatePublicationIT.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
import static org.opensearch.gateway.remote.RemoteClusterStateService.REMOTE_PUBLICATION_SETTING;
5757
import static org.opensearch.gateway.remote.RemoteClusterStateService.REMOTE_PUBLICATION_SETTING_KEY;
5858
import static org.opensearch.gateway.remote.RemoteClusterStateUtils.DELIMITER;
59+
import static org.opensearch.gateway.remote.RemoteDownloadStats.CHECKSUM_VALIDATION_FAILED_COUNT;
5960
import static org.opensearch.gateway.remote.model.RemoteClusterBlocks.CLUSTER_BLOCKS;
6061
import static org.opensearch.gateway.remote.model.RemoteCoordinationMetadata.COORDINATION_METADATA;
6162
import static org.opensearch.gateway.remote.model.RemoteCustomMetadata.CUSTOM_METADATA;
@@ -405,10 +406,28 @@ private void assertDataNodeDownloadStats(NodesStatsResponse nodesStatsResponse)
405406
assertTrue(dataNodeDiscoveryStats.getClusterStateStats().getPersistenceStats().get(0).getSuccessCount() > 0);
406407
assertEquals(0, dataNodeDiscoveryStats.getClusterStateStats().getPersistenceStats().get(0).getFailedCount());
407408
assertTrue(dataNodeDiscoveryStats.getClusterStateStats().getPersistenceStats().get(0).getTotalTimeInMillis() > 0);
409+
assertEquals(
410+
0,
411+
dataNodeDiscoveryStats.getClusterStateStats()
412+
.getPersistenceStats()
413+
.get(0)
414+
.getExtendedFields()
415+
.get(CHECKSUM_VALIDATION_FAILED_COUNT)
416+
.get()
417+
);
408418

409419
assertTrue(dataNodeDiscoveryStats.getClusterStateStats().getPersistenceStats().get(1).getSuccessCount() > 0);
410420
assertEquals(0, dataNodeDiscoveryStats.getClusterStateStats().getPersistenceStats().get(1).getFailedCount());
411421
assertTrue(dataNodeDiscoveryStats.getClusterStateStats().getPersistenceStats().get(1).getTotalTimeInMillis() > 0);
422+
assertEquals(
423+
0,
424+
dataNodeDiscoveryStats.getClusterStateStats()
425+
.getPersistenceStats()
426+
.get(1)
427+
.getExtendedFields()
428+
.get(CHECKSUM_VALIDATION_FAILED_COUNT)
429+
.get()
430+
);
412431
}
413432

414433
private Map<String, Integer> getMetadataFiles(BlobStoreRepository repository, String subDirectory) throws IOException {

server/src/main/java/org/opensearch/common/settings/Setting.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1855,6 +1855,10 @@ public static Setting<Double> doubleSetting(
18551855
);
18561856
}
18571857

1858+
public static Setting<Double> doubleSetting(String key, double defaultValue, Validator<Double> validator, Property... properties) {
1859+
return new Setting<>(key, Double.toString(defaultValue), Double::parseDouble, validator, properties);
1860+
}
1861+
18581862
/**
18591863
* A writeable parser for double
18601864
*
@@ -1961,6 +1965,15 @@ public static Setting<Double> doubleSetting(
19611965
);
19621966
}
19631967

1968+
public static Setting<Double> doubleSetting(
1969+
String key,
1970+
Setting<Double> fallbackSetting,
1971+
Validator<Double> validator,
1972+
Property... properties
1973+
) {
1974+
return new Setting<>(new SimpleKey(key), fallbackSetting, fallbackSetting::getRaw, Double::parseDouble, validator, properties);
1975+
}
1976+
19641977
/// simpleString
19651978

19661979
public static Setting<String> simpleString(String key, Property... properties) {

server/src/main/java/org/opensearch/gateway/remote/RemoteClusterStateService.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1644,6 +1644,12 @@ void validateClusterStateFromChecksum(
16441644
failedValidation
16451645
)
16461646
);
1647+
if (isFullStateDownload) {
1648+
remoteStateStats.stateFullDownloadValidationFailed();
1649+
} else {
1650+
remoteStateStats.stateDiffDownloadValidationFailed();
1651+
}
1652+
16471653
if (isFullStateDownload && remoteClusterStateValidationMode.equals(RemoteClusterStateValidationMode.FAILURE)) {
16481654
throw new IllegalStateException(
16491655
"Cluster state checksums do not match during full state read. Validation failed for " + failedValidation
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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.gateway.remote;
10+
11+
import org.opensearch.cluster.coordination.PersistedStateStats;
12+
13+
import java.util.concurrent.atomic.AtomicLong;
14+
15+
/**
16+
* Download stats for remote state
17+
*
18+
* @opensearch.internal
19+
*/
20+
public class RemoteDownloadStats extends PersistedStateStats {
21+
static final String CHECKSUM_VALIDATION_FAILED_COUNT = "checksum_validation_failed_count";
22+
private AtomicLong checksumValidationFailedCount = new AtomicLong(0);
23+
24+
public RemoteDownloadStats(String statsName) {
25+
super(statsName);
26+
addToExtendedFields(CHECKSUM_VALIDATION_FAILED_COUNT, checksumValidationFailedCount);
27+
}
28+
29+
public void checksumValidationFailedCount() {
30+
checksumValidationFailedCount.incrementAndGet();
31+
}
32+
33+
public long getChecksumValidationFailedCount() {
34+
return checksumValidationFailedCount.get();
35+
}
36+
}

server/src/main/java/org/opensearch/gateway/remote/RemotePersistenceStats.java

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@
1818
public class RemotePersistenceStats {
1919

2020
RemoteUploadStats remoteUploadStats;
21-
PersistedStateStats remoteDiffDownloadStats;
22-
PersistedStateStats remoteFullDownloadStats;
21+
RemoteDownloadStats remoteDiffDownloadStats;
22+
RemoteDownloadStats remoteFullDownloadStats;
2323

2424
final String FULL_DOWNLOAD_STATS = "remote_full_download";
2525
final String DIFF_DOWNLOAD_STATS = "remote_diff_download";
2626

2727
public RemotePersistenceStats() {
2828
remoteUploadStats = new RemoteUploadStats();
29-
remoteDiffDownloadStats = new PersistedStateStats(DIFF_DOWNLOAD_STATS);
30-
remoteFullDownloadStats = new PersistedStateStats(FULL_DOWNLOAD_STATS);
29+
remoteDiffDownloadStats = new RemoteDownloadStats(DIFF_DOWNLOAD_STATS);
30+
remoteFullDownloadStats = new RemoteDownloadStats(FULL_DOWNLOAD_STATS);
3131
}
3232

3333
public void cleanUpAttemptFailed() {
@@ -90,6 +90,22 @@ public void stateDiffDownloadFailed() {
9090
remoteDiffDownloadStats.stateFailed();
9191
}
9292

93+
public void stateDiffDownloadValidationFailed() {
94+
remoteDiffDownloadStats.checksumValidationFailedCount();
95+
}
96+
97+
public void stateFullDownloadValidationFailed() {
98+
remoteFullDownloadStats.checksumValidationFailedCount();
99+
}
100+
101+
public long getStateDiffDownloadValidationFailed() {
102+
return remoteDiffDownloadStats.getChecksumValidationFailedCount();
103+
}
104+
105+
public long getStateFullDownloadValidationFailed() {
106+
return remoteFullDownloadStats.getChecksumValidationFailedCount();
107+
}
108+
93109
public PersistedStateStats getUploadStats() {
94110
return remoteUploadStats;
95111
}

0 commit comments

Comments
 (0)