Skip to content

Commit d0d1ccf

Browse files
committed
Merge remote-tracking branch 'upstream/main' into remote_global_state
Signed-off-by: Dhwanil Patel <[email protected]>
2 parents 3f92a88 + e4c477a commit d0d1ccf

File tree

254 files changed

+5271
-1209
lines changed

Some content is hidden

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

254 files changed

+5271
-1209
lines changed

.github/pull_request_template.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Resolves #[Issue number to be closed when this PR is merged]
1919
- [ ] New functionality has javadoc added
2020
- [ ] Commits are signed per the DCO using --signoff
2121
- [ ] Commit changes are listed out in CHANGELOG.md file (See: [Changelog](../blob/main/CONTRIBUTING.md#changelog))
22+
- [ ] Public documentation issue/PR [created](https://github.com/opensearch-project/documentation-website/issues/new/choose)
2223

2324
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
2425
For more information on following Developer Certificate of Origin and signing off your commits, please check [here](https://github.com/opensearch-project/OpenSearch/blob/main/CONTRIBUTING.md#developer-certificate-of-origin).

.github/workflows/assemble.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Gradle Assemble
2+
on: [pull_request]
3+
4+
jobs:
5+
assemble:
6+
if: github.repository == 'opensearch-project/OpenSearch'
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
matrix:
10+
os: [ubuntu-latest, windows-latest, macos-latest]
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Set up JDK 11
14+
uses: actions/setup-java@v3
15+
with:
16+
java-version: 11
17+
distribution: temurin
18+
- name: Setup docker (missing on MacOS)
19+
if: runner.os == 'macos'
20+
run: |
21+
brew install docker
22+
colima start
23+
sudo ln -sf $HOME/.colima/default/docker.sock /var/run/docker.sock
24+
- name: Run Gradle (assemble)
25+
run: |
26+
./gradlew assemble --parallel --no-build-cache -PDISABLE_BUILD_CACHE

.github/workflows/lucene-snapshots.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
- name: Set hash
3939
working-directory: ./lucene
4040
run: |
41-
echo "::set-output name=REVISION::$(git rev-parse --short HEAD)"
41+
echo "REVISION=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
4242
id: version
4343

4444
- name: Initialize gradle settings

.github/workflows/precommit.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Gradle Precommit and Assemble
1+
name: Gradle Precommit
22
on: [pull_request]
33

44
jobs:
@@ -19,12 +19,3 @@ jobs:
1919
- name: Run Gradle (precommit)
2020
run: |
2121
./gradlew javadoc precommit --parallel
22-
- name: Setup docker (missing on MacOS)
23-
if: runner.os == 'macos'
24-
run: |
25-
brew install docker
26-
colima start
27-
sudo ln -sf $HOME/.colima/default/docker.sock /var/run/docker.sock
28-
- name: Run Gradle (assemble)
29-
run: |
30-
./gradlew assemble --parallel

.github/workflows/version.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
sed -i "s/CURRENT = $CURRENT_VERSION_UNDERSCORE;/CURRENT = $NEXT_VERSION_UNDERSCORE;/g" libs/core/src/main/java/org/opensearch/Version.java
6060
6161
- name: Create Pull Request
62-
uses: peter-evans/create-pull-request@v3
62+
uses: peter-evans/create-pull-request@v5
6363
with:
6464
token: ${{ steps.github_app_token.outputs.token }}
6565
base: ${{ env.BASE }}
@@ -86,7 +86,7 @@ jobs:
8686
sed -i "s/public static final Version $CURRENT_VERSION_UNDERSCORE = new Version(\([[:digit:]]\+\)\(.*\));/\0\n public static final Version $NEXT_VERSION_UNDERSCORE = new Version($NEXT_VERSION_ID\2);/g" libs/core/src/main/java/org/opensearch/Version.java
8787
8888
- name: Create Pull Request
89-
uses: peter-evans/create-pull-request@v3
89+
uses: peter-evans/create-pull-request@v5
9090
with:
9191
token: ${{ steps.github_app_token.outputs.token }}
9292
base: ${{ env.BASE_X }}
@@ -113,7 +113,7 @@ jobs:
113113
sed -i "s/public static final Version $CURRENT_VERSION_UNDERSCORE = new Version(\([[:digit:]]\+\)\(.*\));/\0\n public static final Version $NEXT_VERSION_UNDERSCORE = new Version($NEXT_VERSION_ID\2);/g" libs/core/src/main/java/org/opensearch/Version.java
114114
115115
- name: Create Pull Request
116-
uses: peter-evans/create-pull-request@v3
116+
uses: peter-evans/create-pull-request@v5
117117
with:
118118
token: ${{ steps.github_app_token.outputs.token }}
119119
base: main

CHANGELOG.md

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5454
- Change http code on create index API with bad input raising NotXContentException from 500 to 400 ([#4773](https://github.com/opensearch-project/OpenSearch/pull/4773))
5555
- Improve summary error message for invalid setting updates ([#4792](https://github.com/opensearch-project/OpenSearch/pull/4792))
5656
- Return 409 Conflict HTTP status instead of 503 on failure to concurrently execute snapshots ([#8986](https://github.com/opensearch-project/OpenSearch/pull/5855))
57+
- Performance improvement for Datetime field caching ([#4558](https://github.com/opensearch-project/OpenSearch/issues/4558))
5758

5859
### Deprecated
5960

@@ -89,6 +90,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
8990
- Async blob read support for encrypted containers ([#10131](https://github.com/opensearch-project/OpenSearch/pull/10131))
9091
- Add capability to restrict async durability mode for remote indexes ([#10189](https://github.com/opensearch-project/OpenSearch/pull/10189))
9192
- Add Doc Status Counter for Indexing Engine ([#4562](https://github.com/opensearch-project/OpenSearch/issues/4562))
93+
- Add unreferenced file cleanup count to merge stats ([#10204](https://github.com/opensearch-project/OpenSearch/pull/10204))
94+
- [Remote Store] Add support to restrict creation & deletion if system repository and mutation of immutable settings of system repository ([#9839](https://github.com/opensearch-project/OpenSearch/pull/9839))
95+
- Improve compressed request handling ([#10261](https://github.com/opensearch-project/OpenSearch/pull/10261))
9296

9397
### Dependencies
9498
- Bump `peter-evans/create-or-update-comment` from 2 to 3 ([#9575](https://github.com/opensearch-project/OpenSearch/pull/9575))
@@ -102,15 +106,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
102106
- Bump `tibdex/github-app-token` from 1.5.0 to 2.1.0 ([#10125](https://github.com/opensearch-project/OpenSearch/pull/10125))
103107
- Bump `org.wiremock:wiremock-standalone` from 2.35.0 to 3.1.0 ([#9752](https://github.com/opensearch-project/OpenSearch/pull/9752))
104108
- Bump `com.google.http-client:google-http-client-jackson2` from 1.43.2 to 1.43.3 ([#10126](https://github.com/opensearch-project/OpenSearch/pull/10126))
105-
- Bump `org.xerial.snappy:snappy-java` from 1.1.10.3 to 1.1.10.4 ([#10206](https://github.com/opensearch-project/OpenSearch/pull/10206))
109+
- Bump `org.xerial.snappy:snappy-java` from 1.1.10.3 to 1.1.10.5 ([#10206](https://github.com/opensearch-project/OpenSearch/pull/10206), [#10299](https://github.com/opensearch-project/OpenSearch/pull/10299))
106110
- Bump `com.google.api.grpc:proto-google-common-protos` from 2.10.0 to 2.25.0 ([#10208](https://github.com/opensearch-project/OpenSearch/pull/10208))
107111
- Bump `codecov/codecov-action` from 2 to 3 ([#10209](https://github.com/opensearch-project/OpenSearch/pull/10209))
108-
- Bump `org.bouncycastle:bcpkix-jdk15to18` from 1.75 to 1.76 ([#10219](https://github.com/opensearch-project/OpenSearch/pull/10219))`
109-
- Bump `org.bouncycastle:bcprov-jdk15to18` from 1.75 to 1.76 ([#10219](https://github.com/opensearch-project/OpenSearch/pull/10219))`
110-
- Bump `org.bouncycastle:bcmail-jdk15to18` from 1.75 to 1.76 ([#10219](https://github.com/opensearch-project/OpenSearch/pull/10219))`
111-
- Bump Lucene from 9.7.0 to 9.8.0 ([#10276](https://github.com/opensearch-project/OpenSearch/pull/10276))
112+
- Bump `org.bouncycastle:bcpkix-jdk15to18` from 1.75 to 1.76 ([10219](https://github.com/opensearch-project/OpenSearch/pull/10219))`
113+
- Bump `org.bouncycastle:bcprov-jdk15to18` from 1.75 to 1.76 ([10219](https://github.com/opensearch-project/OpenSearch/pull/10219))`
114+
- Bump `org.bouncycastle:bcmail-jdk15to18` from 1.75 to 1.76 ([10219](https://github.com/opensearch-project/OpenSearch/pull/10219))`
115+
- Bump Lucene from 9.7.0 to 9.8.0 ([10276](https://github.com/opensearch-project/OpenSearch/pull/10276))
116+
- Bump `com.netflix.nebula.ospackage-base` from 11.4.0 to 11.5.0 ([#10295](https://github.com/opensearch-project/OpenSearch/pull/10295))
112117
- Bump asm from 9.5 to 9.6 ([#10302](https://github.com/opensearch-project/OpenSearch/pull/10302))
113118
- Bump netty from 4.1.97.Final to 4.1.99.Final ([#10303](https://github.com/opensearch-project/OpenSearch/pull/10303))
119+
- Bump `peter-evans/create-pull-request` from 3 to 5 ([#10301](https://github.com/opensearch-project/OpenSearch/pull/10301))
120+
- Bump `org.apache.avro:avro` from 1.11.2 to 1.11.3 ([#10210](https://github.com/opensearch-project/OpenSearch/pull/10210))
121+
- Bump `org.bouncycastle:bc-fips` from 1.0.2.3 to 1.0.2.4 ([#10297](https://github.com/opensearch-project/OpenSearch/pull/10297))
114122

115123
### Changed
116124
- Add instrumentation in rest and network layer. ([#9415](https://github.com/opensearch-project/OpenSearch/pull/9415))
@@ -121,6 +129,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
121129
- [Tracing Framework] Add support for SpanKind. ([#10122](https://github.com/opensearch-project/OpenSearch/pull/10122))
122130
- Pass parent filter to inner query in nested query ([#10246](https://github.com/opensearch-project/OpenSearch/pull/10246))
123131
- Disable concurrent segment search when terminate_after is used ([#10200](https://github.com/opensearch-project/OpenSearch/pull/10200))
132+
- Add instrumentation in Inbound Handler. ([#100143](https://github.com/opensearch-project/OpenSearch/pull/10143))
133+
- Enable remote segment upload backpressure by default ([#10356](https://github.com/opensearch-project/OpenSearch/pull/10356))
134+
- [Remote Store] Add support to reload repository metadata inplace ([#9569](https://github.com/opensearch-project/OpenSearch/pull/9569))
135+
- [Metrics Framework] Add Metrics framework. ([#10241](https://github.com/opensearch-project/OpenSearch/pull/10241))
136+
- Updating the separator for RemoteStoreLockManager since underscore is allowed in base64UUID url charset ([#10379](https://github.com/opensearch-project/OpenSearch/pull/10379))
124137

125138
### Deprecated
126139

@@ -132,8 +145,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
132145
- Fix broken backward compatibility from 2.7 for IndexSorted field indices ([#10045](https://github.com/opensearch-project/OpenSearch/pull/10045))
133146
- Fix concurrent search NPE when track_total_hits, terminate_after and size=0 are used ([#10082](https://github.com/opensearch-project/OpenSearch/pull/10082))
134147
- Fix remove ingest processor handing ignore_missing parameter not correctly ([10089](https://github.com/opensearch-project/OpenSearch/pull/10089))
148+
- Fix class_cast_exception when passing int to _version and other metadata fields in ingest simulate API ([#10101](https://github.com/opensearch-project/OpenSearch/pull/10101))
135149
- Fix circular dependency in Settings initialization ([10194](https://github.com/opensearch-project/OpenSearch/pull/10194))
136150
- Fix registration and initialization of multiple extensions ([10256](https://github.com/opensearch-project/OpenSearch/pull/10256))
151+
- Fix Segment Replication ShardLockObtainFailedException bug during index corruption ([10370](https://github.com/opensearch-project/OpenSearch/pull/10370))
137152

138153
### Security
139154

buildSrc/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ dependencies {
103103
api localGroovy()
104104

105105
api 'commons-codec:commons-codec:1.16.0'
106-
api 'org.apache.commons:commons-compress:1.23.0'
106+
api 'org.apache.commons:commons-compress:1.24.0'
107107
api 'org.apache.ant:ant:1.10.14'
108108
api 'com.netflix.nebula:gradle-extra-configurations-plugin:10.0.0'
109109
api 'com.netflix.nebula:nebula-publishing-plugin:20.3.0'

client/rest-high-level/src/main/java/org/opensearch/client/tasks/TaskInfo.java

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public class TaskInfo {
5454
private long runningTimeNanos;
5555
private boolean cancellable;
5656
private boolean cancelled;
57+
private Long cancellationStartTime;
5758
private TaskId parentTaskId;
5859
private final Map<String, Object> status = new HashMap<>();
5960
private final Map<String, String> headers = new HashMap<>();
@@ -127,6 +128,14 @@ void setCancelled(boolean cancelled) {
127128
this.cancelled = cancelled;
128129
}
129130

131+
public Long getCancellationStartTime() {
132+
return this.cancellationStartTime;
133+
}
134+
135+
public void setCancellationStartTime(Long cancellationStartTime) {
136+
this.cancellationStartTime = cancellationStartTime;
137+
}
138+
130139
public TaskId getParentTaskId() {
131140
return parentTaskId;
132141
}
@@ -180,6 +189,7 @@ private void noOpParse(Object s) {}
180189
parser.declareString(TaskInfo::setParentTaskId, new ParseField("parent_task_id"));
181190
parser.declareObject(TaskInfo::setHeaders, (p, c) -> p.mapStrings(), new ParseField("headers"));
182191
parser.declareObject(TaskInfo::setResourceStats, (p, c) -> p.map(), new ParseField("resource_stats"));
192+
parser.declareLong(TaskInfo::setCancellationStartTime, new ParseField("cancellation_time_millis"));
183193
PARSER = (XContentParser p, Void v, String name) -> parser.parse(p, new TaskInfo(new TaskId(name)), null);
184194
}
185195

@@ -199,7 +209,8 @@ && isCancelled() == taskInfo.isCancelled()
199209
&& Objects.equals(getParentTaskId(), taskInfo.getParentTaskId())
200210
&& Objects.equals(status, taskInfo.status)
201211
&& Objects.equals(getHeaders(), taskInfo.getHeaders())
202-
&& Objects.equals(getResourceStats(), taskInfo.getResourceStats());
212+
&& Objects.equals(getResourceStats(), taskInfo.getResourceStats())
213+
&& Objects.equals(getCancellationStartTime(), taskInfo.cancellationStartTime);
203214
}
204215

205216
@Override
@@ -216,7 +227,8 @@ public int hashCode() {
216227
getParentTaskId(),
217228
status,
218229
getHeaders(),
219-
getResourceStats()
230+
getResourceStats(),
231+
getCancellationStartTime()
220232
);
221233
}
222234

@@ -250,6 +262,8 @@ public String toString() {
250262
+ headers
251263
+ ", resource_stats="
252264
+ resourceStats
265+
+ ", cancellationStartTime="
266+
+ cancellationStartTime
253267
+ '}';
254268
}
255269
}

client/rest-high-level/src/test/java/org/opensearch/client/tasks/CancelTasksResponseTests.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ protected CancelTasksResponseTests.ByNodeCancelTasksResponse createServerTestIns
8484
for (int i = 0; i < 4; i++) {
8585
boolean cancellable = randomBoolean();
8686
boolean cancelled = cancellable == true ? randomBoolean() : false;
87+
Long cancellationStartTime = null;
88+
if (cancelled) {
89+
cancellationStartTime = randomNonNegativeLong();
90+
}
8791
tasks.add(
8892
new org.opensearch.tasks.TaskInfo(
8993
new TaskId(NODE_ID, (long) i),
@@ -97,7 +101,8 @@ protected CancelTasksResponseTests.ByNodeCancelTasksResponse createServerTestIns
97101
cancelled,
98102
new TaskId("node1", randomLong()),
99103
Collections.singletonMap("x-header-of", "some-value"),
100-
null
104+
null,
105+
cancellationStartTime
101106
)
102107
);
103108
}
@@ -135,6 +140,7 @@ protected void assertInstances(
135140
assertEquals(ti.isCancelled(), taskInfo.isCancelled());
136141
assertEquals(ti.getParentTaskId().getNodeId(), taskInfo.getParentTaskId().getNodeId());
137142
assertEquals(ti.getParentTaskId().getId(), taskInfo.getParentTaskId().getId());
143+
assertEquals(ti.getCancellationStartTime(), taskInfo.getCancellationStartTime());
138144
FakeTaskStatus status = (FakeTaskStatus) ti.getStatus();
139145
assertEquals(status.code, taskInfo.getStatus().get("code"));
140146
assertEquals(status.status, taskInfo.getStatus().get("status"));

distribution/packages/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ import java.util.regex.Pattern
6363
*/
6464

6565
plugins {
66-
id "com.netflix.nebula.ospackage-base" version "11.4.0"
66+
id "com.netflix.nebula.ospackage-base" version "11.5.0"
6767
}
6868

6969
void addProcessFilesTask(String type, boolean jdk) {

distribution/src/config/opensearch.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,9 @@ ${path.logs}
121121
# index searcher threadpool.
122122
#
123123
#opensearch.experimental.feature.concurrent_segment_search.enabled: false
124+
#
125+
#
126+
# Gates the optimization of datetime formatters caching along with change in default datetime formatter
127+
# Once there is no observed impact on performance, this feature flag can be removed.
128+
#
129+
#opensearch.experimental.optimization.datetime_formatter_caching.enabled: false

distribution/tools/plugin-cli/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ dependencies {
3838
compileOnly project(":server")
3939
compileOnly project(":libs:opensearch-cli")
4040
api "org.bouncycastle:bcpg-fips:1.0.7.1"
41-
api "org.bouncycastle:bc-fips:1.0.2.3"
41+
api "org.bouncycastle:bc-fips:1.0.2.4"
4242
testImplementation project(":test:framework")
4343
testImplementation 'com.google.jimfs:jimfs:1.3.0'
4444
testRuntimeOnly("com.google.guava:guava:${versions.guava}") {

distribution/tools/plugin-cli/licenses/bc-fips-1.0.2.3.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+
9008d04fc13da6455e6a792935b93b629757335d
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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.telemetry.metrics;
10+
11+
import org.opensearch.common.annotation.ExperimentalApi;
12+
import org.opensearch.telemetry.metrics.tags.Tags;
13+
14+
/**
15+
* Counter adds the value to the existing metric.
16+
* {@opensearch.experimental}
17+
*/
18+
@ExperimentalApi
19+
public interface Counter {
20+
21+
/**
22+
* add value.
23+
* @param value value to be added.
24+
*/
25+
void add(double value);
26+
27+
/**
28+
* add value along with the attributes.
29+
*
30+
* @param value value to be added.
31+
* @param tags attributes/dimensions of the metric.
32+
*/
33+
void add(double value, Tags tags);
34+
35+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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.telemetry.metrics;
10+
11+
import java.io.IOException;
12+
13+
/**
14+
* Default implementation for {@link MetricsRegistry}
15+
*/
16+
class DefaultMetricsRegistry implements MetricsRegistry {
17+
private final MetricsTelemetry metricsTelemetry;
18+
19+
/**
20+
* Constructor
21+
* @param metricsTelemetry metrics telemetry.
22+
*/
23+
public DefaultMetricsRegistry(MetricsTelemetry metricsTelemetry) {
24+
this.metricsTelemetry = metricsTelemetry;
25+
}
26+
27+
@Override
28+
public Counter createCounter(String name, String description, String unit) {
29+
return metricsTelemetry.createCounter(name, description, unit);
30+
}
31+
32+
@Override
33+
public Counter createUpDownCounter(String name, String description, String unit) {
34+
return metricsTelemetry.createUpDownCounter(name, description, unit);
35+
}
36+
37+
@Override
38+
public void close() throws IOException {
39+
metricsTelemetry.close();
40+
}
41+
}

0 commit comments

Comments
 (0)