Skip to content

Commit 1ca0ac0

Browse files
authored
Merge branch 'main' into add_changes_for_task_throttle_improvements
Signed-off-by: Sumit Bansal <sumitsb@amazon.com>
2 parents 4c80698 + bcd09ab commit 1ca0ac0

File tree

302 files changed

+15767
-3468
lines changed

Some content is hidden

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

302 files changed

+15767
-3468
lines changed

.github/benchmark-configs.json

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,5 +167,59 @@
167167
"data_instance_config": "4vCPU, 32G Mem, 16G Heap"
168168
},
169169
"baseline_cluster_config": "x64-r5.xlarge-single-node-1-shard-0-replica-baseline"
170+
},
171+
"id_11": {
172+
"description": "Search only test-procedure for big5 with concurrent segment search setting enabled",
173+
"supported_major_versions": ["3"],
174+
"cluster-benchmark-configs": {
175+
"SINGLE_NODE_CLUSTER": "true",
176+
"MIN_DISTRIBUTION": "true",
177+
"TEST_WORKLOAD": "big5",
178+
"ADDITIONAL_CONFIG": "search.concurrent_segment_search.enabled:true",
179+
"WORKLOAD_PARAMS": "{\"snapshot_repo_name\":\"benchmark-workloads-repo-300\",\"snapshot_bucket_name\":\"benchmark-workload-snapshots\",\"snapshot_region\":\"us-east-1\",\"snapshot_base_path\":\"workload-snapshots-300\",\"snapshot_name\":\"big5_1_shard\"}",
180+
"CAPTURE_NODE_STAT": "true",
181+
"TEST_PROCEDURE": "restore-from-snapshot"
182+
},
183+
"cluster_configuration": {
184+
"size": "Single-Node",
185+
"data_instance_config": "4vCPU, 32G Mem, 16G Heap"
186+
},
187+
"baseline_cluster_config": "x64-r5.xlarge-1-shard-0-replica-snapshot-baseline"
188+
},
189+
"id_12": {
190+
"description": "Search only test-procedure for big5 with concurrent segment search mode as all",
191+
"supported_major_versions": ["3"],
192+
"cluster-benchmark-configs": {
193+
"SINGLE_NODE_CLUSTER": "true",
194+
"MIN_DISTRIBUTION": "true",
195+
"TEST_WORKLOAD": "big5",
196+
"ADDITIONAL_CONFIG": "search.concurrent_segment_search.mode:all",
197+
"WORKLOAD_PARAMS": "{\"snapshot_repo_name\":\"benchmark-workloads-repo-300\",\"snapshot_bucket_name\":\"benchmark-workload-snapshots\",\"snapshot_region\":\"us-east-1\",\"snapshot_base_path\":\"workload-snapshots-300\",\"snapshot_name\":\"big5_1_shard\"}",
198+
"CAPTURE_NODE_STAT": "true",
199+
"TEST_PROCEDURE": "restore-from-snapshot"
200+
},
201+
"cluster_configuration": {
202+
"size": "Single-Node",
203+
"data_instance_config": "4vCPU, 32G Mem, 16G Heap"
204+
},
205+
"baseline_cluster_config": "x64-r5.xlarge-1-shard-0-replica-snapshot-baseline"
206+
},
207+
"id_13": {
208+
"description": "Search only test-procedure for big5 with concurrent segment search mode as auto",
209+
"supported_major_versions": ["3"],
210+
"cluster-benchmark-configs": {
211+
"SINGLE_NODE_CLUSTER": "true",
212+
"MIN_DISTRIBUTION": "true",
213+
"TEST_WORKLOAD": "big5",
214+
"ADDITIONAL_CONFIG": "search.concurrent_segment_search.mode:auto",
215+
"WORKLOAD_PARAMS": "{\"snapshot_repo_name\":\"benchmark-workloads-repo-300\",\"snapshot_bucket_name\":\"benchmark-workload-snapshots\",\"snapshot_region\":\"us-east-1\",\"snapshot_base_path\":\"workload-snapshots-300\",\"snapshot_name\":\"big5_1_shard\"}",
216+
"CAPTURE_NODE_STAT": "true",
217+
"TEST_PROCEDURE": "restore-from-snapshot"
218+
},
219+
"cluster_configuration": {
220+
"size": "Single-Node",
221+
"data_instance_config": "4vCPU, 32G Mem, 16G Heap"
222+
},
223+
"baseline_cluster_config": "x64-r5.xlarge-1-shard-0-replica-snapshot-baseline"
170224
}
171225
}

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
3131
- Add support for centralize snapshot creation with pinned timestamp ([#15124](https://github.com/opensearch-project/OpenSearch/pull/15124))
3232
- Add concurrent search support for Derived Fields ([#15326](https://github.com/opensearch-project/OpenSearch/pull/15326))
3333
- [Workload Management] Add query group stats constructs ([#15343](https://github.com/opensearch-project/OpenSearch/pull/15343)))
34+
- Add limit on number of processors for Ingest pipeline([#15460](https://github.com/opensearch-project/OpenSearch/pull/15465)).
3435
- Add runAs to Subject interface and introduce IdentityAwarePlugin extension point ([#14630](https://github.com/opensearch-project/OpenSearch/pull/14630))
3536
- Optimize NodeIndicesStats output behind flag ([#14454](https://github.com/opensearch-project/OpenSearch/pull/14454))
37+
- [Workload Management] Add rejection logic for co-ordinator and shard level requests ([#15428](https://github.com/opensearch-project/OpenSearch/pull/15428)))
38+
- Adding translog durability validation in index templates ([#15494](https://github.com/opensearch-project/OpenSearch/pull/15494))
39+
- Add index creation using the context field ([#15290](https://github.com/opensearch-project/OpenSearch/pull/15290))
40+
- Add fieldType to AbstractQueryBuilder and FieldSortBuilder ([#15328](https://github.com/opensearch-project/OpenSearch/pull/15328)))
41+
- [Reader Writer Separation] Add searchOnly replica routing configuration ([#15410](https://github.com/opensearch-project/OpenSearch/pull/15410))
42+
- [Range Queries] Add new approximateable query framework to short-circuit range queries ([#13788](https://github.com/opensearch-project/OpenSearch/pull/13788))
43+
- [Workload Management] Add query group level failure tracking ([#15227](https://github.com/opensearch-project/OpenSearch/pull/15527))
44+
- Add support to upload snapshot shard blobs with hashed prefix ([#15426](https://github.com/opensearch-project/OpenSearch/pull/15426))
45+
- [Remote Publication] Add remote download stats ([#15291](https://github.com/opensearch-project/OpenSearch/pull/15291)))
46+
- Add support for comma-separated list of index names to be used with Snapshot Status API ([#15409](https://github.com/opensearch-project/OpenSearch/pull/15409))
3647
- ClusterManagerTaskThrottler Improvements ([#15508](https://github.com/opensearch-project/OpenSearch/pull/15508))
3748

3849
### Dependencies
@@ -66,10 +77,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6677
- Add lower limit for primary and replica batch allocators timeout ([#14979](https://github.com/opensearch-project/OpenSearch/pull/14979))
6778
- Optimize regexp-based include/exclude on aggregations when pattern matches prefixes ([#14371](https://github.com/opensearch-project/OpenSearch/pull/14371))
6879
- Replace and block usages of org.apache.logging.log4j.util.Strings ([#15238](https://github.com/opensearch-project/OpenSearch/pull/15238))
80+
- Remote publication using minimum node version for backward compatibility ([#15216](https://github.com/opensearch-project/OpenSearch/pull/15216))
81+
6982

7083
### Deprecated
7184

7285
### Removed
86+
- Remove some unused code in the search backpressure package ([#15518](https://github.com/opensearch-project/OpenSearch/pull/15518))
7387

7488
### Fixed
7589
- Fix constraint bug which allows more primary shards than average primary shards per index ([#14908](https://github.com/opensearch-project/OpenSearch/pull/14908))
@@ -83,6 +97,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
8397
- Fix indexing error when flat_object field is explicitly null ([#15375](https://github.com/opensearch-project/OpenSearch/pull/15375))
8498
- Fix split response processor not included in allowlist ([#15393](https://github.com/opensearch-project/OpenSearch/pull/15393))
8599
- Fix unchecked cast in dynamic action map getter ([#15394](https://github.com/opensearch-project/OpenSearch/pull/15394))
100+
- Fix null values indexed as "null" strings in flat_object field ([#14069](https://github.com/opensearch-project/OpenSearch/pull/14069))
86101

87102
### Security
88103

client/rest-high-level/src/main/java/org/opensearch/client/indices/GetIndexResponse.java

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434

3535
import org.apache.lucene.util.CollectionUtil;
3636
import org.opensearch.cluster.metadata.AliasMetadata;
37+
import org.opensearch.cluster.metadata.Context;
3738
import org.opensearch.cluster.metadata.MappingMetadata;
3839
import org.opensearch.common.settings.Settings;
3940
import org.opensearch.core.xcontent.XContentParser;
@@ -61,6 +62,7 @@ public class GetIndexResponse {
6162
private Map<String, Settings> settings;
6263
private Map<String, Settings> defaultSettings;
6364
private Map<String, String> dataStreams;
65+
private Map<String, Context> contexts;
6466
private String[] indices;
6567

6668
GetIndexResponse(
@@ -69,7 +71,8 @@ public class GetIndexResponse {
6971
Map<String, List<AliasMetadata>> aliases,
7072
Map<String, Settings> settings,
7173
Map<String, Settings> defaultSettings,
72-
Map<String, String> dataStreams
74+
Map<String, String> dataStreams,
75+
Map<String, Context> contexts
7376
) {
7477
this.indices = indices;
7578
// to have deterministic order
@@ -89,6 +92,9 @@ public class GetIndexResponse {
8992
if (dataStreams != null) {
9093
this.dataStreams = dataStreams;
9194
}
95+
if (contexts != null) {
96+
this.contexts = contexts;
97+
}
9298
}
9399

94100
public String[] getIndices() {
@@ -123,6 +129,10 @@ public Map<String, String> getDataStreams() {
123129
return dataStreams;
124130
}
125131

132+
public Map<String, Context> contexts() {
133+
return contexts;
134+
}
135+
126136
/**
127137
* Returns the string value for the specified index and setting. If the includeDefaults flag was not set or set to
128138
* false on the {@link GetIndexRequest}, this method will only return a value where the setting was explicitly set
@@ -167,6 +177,7 @@ private static IndexEntry parseIndexEntry(XContentParser parser) throws IOExcept
167177
Settings indexSettings = null;
168178
Settings indexDefaultSettings = null;
169179
String dataStream = null;
180+
Context context = null;
170181
// We start at START_OBJECT since fromXContent ensures that
171182
while (parser.nextToken() != Token.END_OBJECT) {
172183
ensureExpectedToken(Token.FIELD_NAME, parser.currentToken(), parser);
@@ -185,6 +196,9 @@ private static IndexEntry parseIndexEntry(XContentParser parser) throws IOExcept
185196
case "defaults":
186197
indexDefaultSettings = Settings.fromXContent(parser);
187198
break;
199+
case "context":
200+
context = Context.fromXContent(parser);
201+
break;
188202
default:
189203
parser.skipChildren();
190204
}
@@ -197,7 +211,7 @@ private static IndexEntry parseIndexEntry(XContentParser parser) throws IOExcept
197211
parser.skipChildren();
198212
}
199213
}
200-
return new IndexEntry(indexAliases, indexMappings, indexSettings, indexDefaultSettings, dataStream);
214+
return new IndexEntry(indexAliases, indexMappings, indexSettings, indexDefaultSettings, dataStream, context);
201215
}
202216

203217
// This is just an internal container to make stuff easier for returning
@@ -207,19 +221,22 @@ private static class IndexEntry {
207221
Settings indexSettings = Settings.EMPTY;
208222
Settings indexDefaultSettings = Settings.EMPTY;
209223
String dataStream;
224+
Context context;
210225

211226
IndexEntry(
212227
List<AliasMetadata> indexAliases,
213228
MappingMetadata indexMappings,
214229
Settings indexSettings,
215230
Settings indexDefaultSettings,
216-
String dataStream
231+
String dataStream,
232+
Context context
217233
) {
218234
if (indexAliases != null) this.indexAliases = indexAliases;
219235
if (indexMappings != null) this.indexMappings = indexMappings;
220236
if (indexSettings != null) this.indexSettings = indexSettings;
221237
if (indexDefaultSettings != null) this.indexDefaultSettings = indexDefaultSettings;
222238
if (dataStream != null) this.dataStream = dataStream;
239+
if (context != null) this.context = context;
223240
}
224241
}
225242

@@ -229,6 +246,7 @@ public static GetIndexResponse fromXContent(XContentParser parser) throws IOExce
229246
Map<String, Settings> settings = new HashMap<>();
230247
Map<String, Settings> defaultSettings = new HashMap<>();
231248
Map<String, String> dataStreams = new HashMap<>();
249+
Map<String, Context> contexts = new HashMap<>();
232250
List<String> indices = new ArrayList<>();
233251

234252
if (parser.currentToken() == null) {
@@ -254,12 +272,15 @@ public static GetIndexResponse fromXContent(XContentParser parser) throws IOExce
254272
if (indexEntry.dataStream != null) {
255273
dataStreams.put(indexName, indexEntry.dataStream);
256274
}
275+
if (indexEntry.context != null) {
276+
contexts.put(indexName, indexEntry.context);
277+
}
257278
} else if (parser.currentToken() == Token.START_ARRAY) {
258279
parser.skipChildren();
259280
} else {
260281
parser.nextToken();
261282
}
262283
}
263-
return new GetIndexResponse(indices.toArray(new String[0]), mappings, aliases, settings, defaultSettings, dataStreams);
284+
return new GetIndexResponse(indices.toArray(new String[0]), mappings, aliases, settings, defaultSettings, dataStreams, contexts);
264285
}
265286
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,14 +230,15 @@ public void testSnapshotsStatus() {
230230
Map<String, String> expectedParams = new HashMap<>();
231231
String repository = RequestConvertersTests.randomIndicesNames(1, 1)[0];
232232
String[] snapshots = RequestConvertersTests.randomIndicesNames(1, 5);
233+
String[] indices = RequestConvertersTests.randomIndicesNames(1, 5);
233234
StringBuilder snapshotNames = new StringBuilder(snapshots[0]);
234235
for (int idx = 1; idx < snapshots.length; idx++) {
235236
snapshotNames.append(",").append(snapshots[idx]);
236237
}
237238
boolean ignoreUnavailable = randomBoolean();
238239
String endpoint = "/_snapshot/" + repository + "/" + snapshotNames.toString() + "/_status";
239240

240-
SnapshotsStatusRequest snapshotsStatusRequest = new SnapshotsStatusRequest(repository, snapshots);
241+
SnapshotsStatusRequest snapshotsStatusRequest = new SnapshotsStatusRequest(repository, snapshots, indices);
241242
RequestConvertersTests.setRandomClusterManagerTimeout(snapshotsStatusRequest, expectedParams);
242243
snapshotsStatusRequest.ignoreUnavailable(ignoreUnavailable);
243244
expectedParams.put("ignore_unavailable", Boolean.toString(ignoreUnavailable));

client/rest-high-level/src/test/java/org/opensearch/client/indices/GetIndexResponseTests.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import org.opensearch.client.AbstractResponseTestCase;
3737
import org.opensearch.client.GetAliasesResponseTests;
3838
import org.opensearch.cluster.metadata.AliasMetadata;
39+
import org.opensearch.cluster.metadata.Context;
3940
import org.opensearch.cluster.metadata.MappingMetadata;
4041
import org.opensearch.common.settings.IndexScopedSettings;
4142
import org.opensearch.common.settings.Settings;
@@ -66,6 +67,7 @@ protected org.opensearch.action.admin.indices.get.GetIndexResponse createServerT
6667
final Map<String, Settings> settings = new HashMap<>();
6768
final Map<String, Settings> defaultSettings = new HashMap<>();
6869
final Map<String, String> dataStreams = new HashMap<>();
70+
final Map<String, Context> contexts = new HashMap<>();
6971
IndexScopedSettings indexScopedSettings = IndexScopedSettings.DEFAULT_SCOPED_SETTINGS;
7072
boolean includeDefaults = randomBoolean();
7173
for (String index : indices) {
@@ -90,14 +92,19 @@ protected org.opensearch.action.admin.indices.get.GetIndexResponse createServerT
9092
if (randomBoolean()) {
9193
dataStreams.put(index, randomAlphaOfLength(5).toLowerCase(Locale.ROOT));
9294
}
95+
96+
if (randomBoolean()) {
97+
contexts.put(index, new Context(randomAlphaOfLength(5).toLowerCase(Locale.ROOT)));
98+
}
9399
}
94100
return new org.opensearch.action.admin.indices.get.GetIndexResponse(
95101
indices,
96102
mappings,
97103
aliases,
98104
settings,
99105
defaultSettings,
100-
dataStreams
106+
dataStreams,
107+
null
101108
);
102109
}
103110

@@ -116,6 +123,7 @@ protected void assertInstances(
116123
assertEquals(serverTestInstance.getSettings(), clientInstance.getSettings());
117124
assertEquals(serverTestInstance.defaultSettings(), clientInstance.getDefaultSettings());
118125
assertEquals(serverTestInstance.getAliases(), clientInstance.getAliases());
126+
assertEquals(serverTestInstance.contexts(), clientInstance.contexts());
119127
}
120128

121129
private static MappingMetadata createMappingsForIndex() {

libs/common/src/main/java/org/opensearch/common/annotation/processor/ApiAnnotationProcessor.java

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public class ApiAnnotationProcessor extends AbstractProcessor {
5959
private static final String OPENSEARCH_PACKAGE = "org.opensearch";
6060

6161
private final Set<Element> reported = new HashSet<>();
62+
private final Set<Element> validated = new HashSet<>();
6263
private final Set<AnnotatedConstruct> processed = new HashSet<>();
6364
private Kind reportFailureAs = Kind.ERROR;
6465

@@ -85,6 +86,8 @@ public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment
8586
);
8687

8788
for (var element : elements) {
89+
validate(element);
90+
8891
if (!checkPackage(element)) {
8992
continue;
9093
}
@@ -100,6 +103,64 @@ public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment
100103
return false;
101104
}
102105

106+
private void validate(Element element) {
107+
// The element was validated already
108+
if (validated.contains(element)) {
109+
return;
110+
}
111+
112+
validated.add(element);
113+
114+
final PublicApi publicApi = element.getAnnotation(PublicApi.class);
115+
if (publicApi != null) {
116+
if (!validateVersion(publicApi.since())) {
117+
processingEnv.getMessager()
118+
.printMessage(
119+
reportFailureAs,
120+
"The type " + element + " has @PublicApi annotation with unparseable OpenSearch version: " + publicApi.since()
121+
);
122+
}
123+
}
124+
125+
final DeprecatedApi deprecatedApi = element.getAnnotation(DeprecatedApi.class);
126+
if (deprecatedApi != null) {
127+
if (!validateVersion(deprecatedApi.since())) {
128+
processingEnv.getMessager()
129+
.printMessage(
130+
reportFailureAs,
131+
"The type "
132+
+ element
133+
+ " has @DeprecatedApi annotation with unparseable OpenSearch version: "
134+
+ deprecatedApi.since()
135+
);
136+
}
137+
}
138+
}
139+
140+
private boolean validateVersion(String version) {
141+
String[] parts = version.split("[.-]");
142+
if (parts.length < 3 || parts.length > 4) {
143+
return false;
144+
}
145+
146+
int major = Integer.parseInt(parts[0]);
147+
if (major > 3 || major < 0) {
148+
return false;
149+
}
150+
151+
int minor = Integer.parseInt(parts[1]);
152+
if (minor < 0) {
153+
return false;
154+
}
155+
156+
int patch = Integer.parseInt(parts[2]);
157+
if (patch < 0) {
158+
return false;
159+
}
160+
161+
return true;
162+
}
163+
103164
/**
104165
* Check top level executable element
105166
* @param executable top level executable element

0 commit comments

Comments
 (0)