Skip to content

Commit 3f0587a

Browse files
Merge branch 'main' into passing-indicesService-to-processor-factories
Signed-off-by: Martin Gaievski <[email protected]>
2 parents 41cad1d + 6003560 commit 3f0587a

File tree

195 files changed

+3627
-1204
lines changed

Some content is hidden

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

195 files changed

+3627
-1204
lines changed

.github/workflows/gradle-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
7373
- name: Upload Coverage Report
7474
if: success()
75-
uses: codecov/codecov-action@v2
75+
uses: codecov/codecov-action@v3
7676
with:
7777
files: ./codeCoverage.xml
7878

.github/workflows/stalled.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Label Stalled PRs
2+
on:
3+
schedule:
4+
- cron: '15 15 * * *' # Run every day at 15:15 UTC / 7:15 PST / 8:15 PDT
5+
permissions:
6+
pull-requests: write
7+
jobs:
8+
stale:
9+
if: github.repository == 'opensearch-project/OpenSearch'
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: GitHub App token
13+
id: github_app_token
14+
uses: tibdex/[email protected]
15+
with:
16+
app_id: ${{ secrets.APP_ID }}
17+
private_key: ${{ secrets.APP_PRIVATE_KEY }}
18+
installation_id: 22958780
19+
- name: Stale PRs
20+
uses: actions/stale@v8
21+
with:
22+
repo-token: ${{ steps.github_app_token.outputs.token }}
23+
stale-pr-label: 'stalled'
24+
stale-pr-message: 'This PR is stalled because it has been open for 30 days with no activity.'
25+
days-before-pr-stale: 30
26+
days-before-issue-stale: -1
27+
days-before-pr-close: -1
28+
days-before-issue-close: -1

CHANGELOG.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1212
- Introduce new dynamic cluster setting to control slice computation for concurrent segment search ([#9107](https://github.com/opensearch-project/OpenSearch/pull/9107))
1313
- Implement on behalf of token passing for extensions ([#8679](https://github.com/opensearch-project/OpenSearch/pull/8679))
1414
- Implement Visitor Design pattern in QueryBuilder to enable the capability to traverse through the complex QueryBuilder tree. ([#10110](https://github.com/opensearch-project/OpenSearch/pull/10110))
15+
- Provide service accounts tokens to extensions ([#9618](https://github.com/opensearch-project/OpenSearch/pull/9618))
1516
- Allowing pipeline processors to access index maping info by passing ingest service ref as part of the processor factory parameters ([#10307](https://github.com/opensearch-project/OpenSearch/pull/10307))
1617

1718
### Dependencies
@@ -85,6 +86,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
8586
- Add metrics for thread_pool task wait time ([#9681](https://github.com/opensearch-project/OpenSearch/pull/9681))
8687
- Async blob read support for S3 plugin ([#9694](https://github.com/opensearch-project/OpenSearch/pull/9694))
8788
- [Telemetry-Otel] Added support for OtlpGrpcSpanExporter exporter ([#9666](https://github.com/opensearch-project/OpenSearch/pull/9666))
89+
- Async blob read support for encrypted containers ([#10131](https://github.com/opensearch-project/OpenSearch/pull/10131))
90+
- Add capability to restrict async durability mode for remote indexes ([#10189](https://github.com/opensearch-project/OpenSearch/pull/10189))
91+
- Add Doc Status Counter for Indexing Engine ([#4562](https://github.com/opensearch-project/OpenSearch/issues/4562))
8892

8993
### Dependencies
9094
- Bump `peter-evans/create-or-update-comment` from 2 to 3 ([#9575](https://github.com/opensearch-project/OpenSearch/pull/9575))
@@ -97,20 +101,34 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
97101
- Bump `com.zaxxer:SparseBitSet` from 1.2 to 1.3 ([#10098](https://github.com/opensearch-project/OpenSearch/pull/10098))
98102
- Bump `tibdex/github-app-token` from 1.5.0 to 2.1.0 ([#10125](https://github.com/opensearch-project/OpenSearch/pull/10125))
99103
- Bump `org.wiremock:wiremock-standalone` from 2.35.0 to 3.1.0 ([#9752](https://github.com/opensearch-project/OpenSearch/pull/9752))
104+
- 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))
106+
- 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))
107+
- 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 asm from 9.5 to 9.6 ([#10302](https://github.com/opensearch-project/OpenSearch/pull/10302))
100113

101114
### Changed
102115
- Add instrumentation in rest and network layer. ([#9415](https://github.com/opensearch-project/OpenSearch/pull/9415))
103116
- Allow parameterization of tests with OpenSearchIntegTestCase.SuiteScopeTestCase annotation ([#9916](https://github.com/opensearch-project/OpenSearch/pull/9916))
104117
- Mute the query profile IT with concurrent execution ([#9840](https://github.com/opensearch-project/OpenSearch/pull/9840))
118+
- Force merge with `only_expunge_deletes` honors max segment size ([#10036](https://github.com/opensearch-project/OpenSearch/pull/10036))
105119
- Add instrumentation in transport service. ([#10042](https://github.com/opensearch-project/OpenSearch/pull/10042))
120+
- [Tracing Framework] Add support for SpanKind. ([#10122](https://github.com/opensearch-project/OpenSearch/pull/10122))
121+
- Pass parent filter to inner query in nested query ([#10246](https://github.com/opensearch-project/OpenSearch/pull/10246))
106122

107123
### Deprecated
108124

109125
### Removed
110126

111127
### Fixed
112128
- Fix ignore_missing parameter has no effect when using template snippet in rename ingest processor ([#9725](https://github.com/opensearch-project/OpenSearch/pull/9725))
113-
- Fix broken backward compatibility from 2.7 for IndexSorted field indices ([#10045](https://github.com/opensearch-project/OpenSearch/pull/9725))
129+
- Fix broken backward compatibility from 2.7 for IndexSorted field indices ([#10045](https://github.com/opensearch-project/OpenSearch/pull/10045))
130+
- Fix concurrent search NPE when track_total_hits, terminate_after and size=0 are used ([#10082](https://github.com/opensearch-project/OpenSearch/pull/10082))
131+
- Fix remove ingest processor handing ignore_missing parameter not correctly ([10089](https://github.com/opensearch-project/OpenSearch/pull/10089))
114132

115133
### Security
116134

buildSrc/version.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
opensearch = 3.0.0
2-
lucene = 9.8.0-snapshot-95cdd2e
2+
lucene = 9.8.0
33

44
bundled_jdk_vendor = adoptium
55
bundled_jdk = 20.0.2+9
@@ -16,7 +16,7 @@ icu4j = 70.1
1616
supercsv = 2.4.0
1717
log4j = 2.20.0
1818
slf4j = 1.7.36
19-
asm = 9.5
19+
asm = 9.6
2020
jettison = 1.5.4
2121
woodstox = 6.4.0
2222
kotlin = 1.7.10
@@ -48,7 +48,7 @@ reactivestreams = 1.0.4
4848
# when updating this version, you need to ensure compatibility with:
4949
# - plugins/ingest-attachment (transitive dependency, check the upstream POM)
5050
# - distribution/tools/plugin-cli
51-
bouncycastle=1.75
51+
bouncycastle=1.76
5252
# test dependencies
5353
randomizedrunner = 2.7.1
5454
junit = 4.13.2

libs/core/licenses/lucene-core-9.8.0-snapshot-95cdd2e.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+
5e8421c5f8573bcf22e9265fc7e19469545a775a

libs/core/src/main/java/org/opensearch/core/index/Index.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public class Index implements Writeable, ToXContentObject {
5959
public static final Index[] EMPTY_ARRAY = new Index[0];
6060
private static final String INDEX_UUID_KEY = "index_uuid";
6161
private static final String INDEX_NAME_KEY = "index_name";
62+
public static final String UNKNOWN_INDEX_NAME = "_unknown_";
6263

6364
private static final ObjectParser<Builder, Void> INDEX_PARSER = new ObjectParser<>("index", Builder::new);
6465
static {

libs/core/src/main/java/org/opensearch/core/rest/RestStatus.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,15 @@ public int getStatus() {
527527
return status;
528528
}
529529

530+
/**
531+
* Get category class of a rest status code.
532+
*
533+
* @return Integer representing class category of the concrete rest status code
534+
*/
535+
public int getStatusFamilyCode() {
536+
return status / 100;
537+
}
538+
530539
public static RestStatus readFrom(StreamInput in) throws IOException {
531540
return RestStatus.valueOf(in.readString());
532541
}

libs/telemetry/src/main/java/org/opensearch/telemetry/tracing/DefaultTracer.java

Lines changed: 9 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
package org.opensearch.telemetry.tracing;
1010

1111
import org.opensearch.common.annotation.InternalApi;
12-
import org.opensearch.telemetry.tracing.attributes.Attributes;
1312

1413
import java.io.Closeable;
1514
import java.io.IOException;
@@ -44,27 +43,13 @@ public DefaultTracer(TracingTelemetry tracingTelemetry, TracerContextStorage<Str
4443

4544
@Override
4645
public Span startSpan(SpanCreationContext context) {
47-
return startSpan(context.getSpanName(), context.getAttributes());
48-
}
49-
50-
@Override
51-
public Span startSpan(String spanName) {
52-
return startSpan(spanName, Attributes.EMPTY);
53-
}
54-
55-
@Override
56-
public Span startSpan(String spanName, Attributes attributes) {
57-
return startSpan(spanName, (SpanContext) null, attributes);
58-
}
59-
60-
@Override
61-
public Span startSpan(String spanName, SpanContext parentSpan, Attributes attributes) {
62-
Span span = null;
63-
if (parentSpan != null) {
64-
span = createSpan(spanName, parentSpan.getSpan(), attributes);
46+
Span parentSpan = null;
47+
if (context.getParent() != null) {
48+
parentSpan = context.getParent().getSpan();
6549
} else {
66-
span = createSpan(spanName, getCurrentSpanInternal(), attributes);
50+
parentSpan = getCurrentSpanInternal();
6751
}
52+
Span span = createSpan(context, parentSpan);
6853
setCurrentSpanInContext(span);
6954
addDefaultAttributes(span);
7055
return span;
@@ -87,12 +72,7 @@ public SpanContext getCurrentSpan() {
8772

8873
@Override
8974
public ScopedSpan startScopedSpan(SpanCreationContext spanCreationContext) {
90-
return startScopedSpan(spanCreationContext, null);
91-
}
92-
93-
@Override
94-
public ScopedSpan startScopedSpan(SpanCreationContext spanCreationContext, SpanContext parentSpan) {
95-
Span span = startSpan(spanCreationContext.getSpanName(), parentSpan, spanCreationContext.getAttributes());
75+
Span span = startSpan(spanCreationContext);
9676
SpanScope spanScope = withSpanInScope(span);
9777
return new DefaultScopedSpan(span, spanScope);
9878
}
@@ -102,8 +82,8 @@ public SpanScope withSpanInScope(Span span) {
10282
return DefaultSpanScope.create(span, tracerContextStorage).attach();
10383
}
10484

105-
private Span createSpan(String spanName, Span parentSpan, Attributes attributes) {
106-
return tracingTelemetry.createSpan(spanName, parentSpan, attributes);
85+
private Span createSpan(SpanCreationContext spanCreationContext, Span parentSpan) {
86+
return tracingTelemetry.createSpan(spanCreationContext, parentSpan);
10787
}
10888

10989
private void setCurrentSpanInContext(Span span) {
@@ -121,11 +101,7 @@ protected void addDefaultAttributes(Span span) {
121101
@Override
122102
public Span startSpan(SpanCreationContext spanCreationContext, Map<String, List<String>> headers) {
123103
Optional<Span> propagatedSpan = tracingTelemetry.getContextPropagator().extractFromHeaders(headers);
124-
return startSpan(
125-
spanCreationContext.getSpanName(),
126-
propagatedSpan.map(SpanContext::new).orElse(null),
127-
spanCreationContext.getAttributes()
128-
);
104+
return startSpan(spanCreationContext.parent(propagatedSpan.map(SpanContext::new).orElse(null)));
129105
}
130106

131107
}

libs/telemetry/src/main/java/org/opensearch/telemetry/tracing/SpanCreationContext.java

Lines changed: 77 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,74 @@
1818
*/
1919
@ExperimentalApi
2020
public final class SpanCreationContext {
21-
private final String spanName;
22-
private final Attributes attributes;
21+
private String spanName;
22+
private Attributes attributes;
23+
private SpanKind spanKind = SpanKind.INTERNAL;
24+
private SpanContext parent;
2325

2426
/**
2527
* Constructor.
28+
*/
29+
private SpanCreationContext() {}
30+
31+
/**
32+
* Sets the span type to server.
33+
* @return spanCreationContext
34+
*/
35+
public static SpanCreationContext server() {
36+
SpanCreationContext spanCreationContext = new SpanCreationContext();
37+
spanCreationContext.spanKind = SpanKind.SERVER;
38+
return spanCreationContext;
39+
}
40+
41+
/**
42+
* Sets the span type to client.
43+
* @return spanCreationContext
44+
*/
45+
public static SpanCreationContext client() {
46+
SpanCreationContext spanCreationContext = new SpanCreationContext();
47+
spanCreationContext.spanKind = SpanKind.CLIENT;
48+
return spanCreationContext;
49+
}
50+
51+
/**
52+
* Sets the span type to internal.
53+
* @return spanCreationContext
54+
*/
55+
public static SpanCreationContext internal() {
56+
SpanCreationContext spanCreationContext = new SpanCreationContext();
57+
spanCreationContext.spanKind = SpanKind.INTERNAL;
58+
return spanCreationContext;
59+
}
60+
61+
/**
62+
* Sets the span name.
2663
* @param spanName span name.
27-
* @param attributes attributes.
64+
* @return spanCreationContext
2865
*/
29-
public SpanCreationContext(String spanName, Attributes attributes) {
66+
public SpanCreationContext name(String spanName) {
3067
this.spanName = spanName;
68+
return this;
69+
}
70+
71+
/**
72+
* Sets the span attributes.
73+
* @param attributes attributes.
74+
* @return spanCreationContext
75+
*/
76+
public SpanCreationContext attributes(Attributes attributes) {
3177
this.attributes = attributes;
78+
return this;
79+
}
80+
81+
/**
82+
* Sets the parent for spann
83+
* @param parent parent
84+
* @return spanCreationContext
85+
*/
86+
public SpanCreationContext parent(SpanContext parent) {
87+
this.parent = parent;
88+
return this;
3289
}
3390

3491
/**
@@ -46,4 +103,20 @@ public String getSpanName() {
46103
public Attributes getAttributes() {
47104
return attributes;
48105
}
106+
107+
/**
108+
* Returns the span kind.
109+
* @return spankind.
110+
*/
111+
public SpanKind getSpanKind() {
112+
return spanKind;
113+
}
114+
115+
/**
116+
* Returns the parent span
117+
* @return parent.
118+
*/
119+
public SpanContext getParent() {
120+
return parent;
121+
}
49122
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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.tracing;
10+
11+
import org.opensearch.common.annotation.PublicApi;
12+
13+
/**
14+
* Type of Span.
15+
*/
16+
@PublicApi(since = "2.11.0")
17+
public enum SpanKind {
18+
/**
19+
* Span represents the client side code.
20+
*/
21+
CLIENT,
22+
/**
23+
* Span represents the server side code.
24+
*/
25+
SERVER,
26+
27+
/**
28+
* Span represents the internal calls. This is the default value of a span type.
29+
*/
30+
INTERNAL;
31+
}

0 commit comments

Comments
 (0)