Skip to content

Commit 12d755c

Browse files
authored
Merge branch 'main' into fix-rescore-named-queries
Signed-off-by: Marc Handalian <[email protected]>
2 parents 7ff4d3d + e1fc79e commit 12d755c

File tree

48 files changed

+527
-206
lines changed

Some content is hidden

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

48 files changed

+527
-206
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
77
### Added
88
- Add support for Warm Indices Write Block on Flood Watermark breach ([#18375](https://github.com/opensearch-project/OpenSearch/pull/18375))
99
- Add support for custom index name resolver from cluster plugin ([#18593](https://github.com/opensearch-project/OpenSearch/pull/18593))
10+
- Rename WorkloadGroupTestUtil to WorkloadManagementTestUtil ([#18709](https://github.com/opensearch-project/OpenSearch/pull/18709))
1011
- Disallow resize for Warm Index, add Parameterized ITs for close in remote store ([#18686](https://github.com/opensearch-project/OpenSearch/pull/18686))
1112
- Ability to run Code Coverage with Gradle and produce the jacoco reports locally ([#18509](https://github.com/opensearch-project/OpenSearch/issues/18509))
13+
- [Workload Management] Update logging and Javadoc, rename QueryGroup to WorkloadGroup ([#18711](https://github.com/opensearch-project/OpenSearch/issues/18711))
1214
- Add NodeResourceUsageStats to ClusterInfo ([#18480](https://github.com/opensearch-project/OpenSearch/issues/18472))
1315
- Introduce SecureHttpTransportParameters experimental API (to complement SecureTransportParameters counterpart) ([#18572](https://github.com/opensearch-project/OpenSearch/issues/18572))
1416
- Create equivalents of JSM's AccessController in the java agent ([#18346](https://github.com/opensearch-project/OpenSearch/issues/18346))
@@ -21,6 +23,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
2123
- Add support for non-timing info in profiler ([#18460](https://github.com/opensearch-project/OpenSearch/issues/18460))
2224
- Extend Approximation Framework to other numeric types ([#18530](https://github.com/opensearch-project/OpenSearch/issues/18530))
2325
- Add Semantic Version field type mapper and extensive unit tests([#18454](https://github.com/opensearch-project/OpenSearch/pull/18454))
26+
- Pass index settings to system ingest processor factories. ([#18708](https://github.com/opensearch-project/OpenSearch/pull/18708))
2427
- Include named queries from rescore contexts in matched_queries array ([#18697](https://github.com/opensearch-project/OpenSearch/pull/18697))
2528

2629
### Changed
@@ -42,6 +45,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
4245
- Bump `org.bouncycastle:bcpkix-fips` from 2.0.7 to 2.0.8 ([#18668](https://github.com/opensearch-project/OpenSearch/pull/18668))
4346
- Bump `org.bouncycastle:bcpg-fips` from 2.0.10 to 2.0.11 ([#18668](https://github.com/opensearch-project/OpenSearch/pull/18668))
4447
- Bump `com.password4j:password4j` from 1.8.2 to 1.8.3 ([#18668](https://github.com/opensearch-project/OpenSearch/pull/18668))
48+
- Bump `com.azure:azure-core` from 1.55.3 to 1.55.5 ([#18691](https://github.com/opensearch-project/OpenSearch/pull/18691))
4549

4650
### Deprecated
4751

@@ -56,6 +60,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5660
- Fix the visit of sub queries for HasParentQuery and HasChildQuery ([#18621](https://github.com/opensearch-project/OpenSearch/pull/18621))
5761
- Fix the backward compatibility regression with COMPLEMENT for Regexp queries introduced in OpenSearch 3.0 ([#18640](https://github.com/opensearch-project/OpenSearch/pull/18640))
5862
- Fix Replication lag computation ([#18602](https://github.com/opensearch-project/OpenSearch/pull/18602))
63+
- Fixed Staggered merge - load average replace with AverageTrackers, some Default thresholds modified ([#18666](https://github.com/opensearch-project/OpenSearch/pull/18666))
5964

6065
### Security
6166

MAINTAINERS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ This document contains a list of maintainers in this repo. See [opensearch-proje
2828
| Owais Kazi | [owaiskazi19](https://github.com/owaiskazi19) | Amazon |
2929
| Pan Guixin | [bugmakerrrrrr](https://github.com/bugmakerrrrrr) | ByteDance |
3030
| Peter Nied | [peternied](https://github.com/peternied) | Amazon |
31+
| Prudhvi Godithi | [prudhvigodithi](https://github.com/prudhvigodithi) | Amazon |
3132
| Rishabh Maurya | [rishabhmaurya](https://github.com/rishabhmaurya) | Amazon |
3233
| Rishikesh Pasham | [Rishikesh1159](https://github.com/Rishikesh1159) | Amazon |
3334
| Sachin Kale | [sachinpkale](https://github.com/sachinpkale) | Amazon |

modules/autotagging-commons/common/src/main/java/org/opensearch/rule/autotagging/Rule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* of a rule. The indexed view may differ in representation.
3232
* {
3333
* "id": "fwehf8302582mglfio349==",
34-
* "description": "Assign Query Group for Index Logs123"
34+
* "description": "Assign Workload Group for Index Logs123"
3535
* "index_pattern": ["logs123"],
3636
* "workload_group": "dev_workload_group_id",
3737
* "updated_at": "01-10-2025T21:23:21.456Z"

plugins/examples/system-ingest-processor/src/main/java/org/opensearch/example/systemingestprocessor/ExampleSystemIngestProcessorFactory.java

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,20 @@
88

99
package org.opensearch.example.systemingestprocessor;
1010

11+
import org.opensearch.common.settings.Settings;
1112
import org.opensearch.ingest.AbstractBatchingSystemProcessor;
1213

1314
import java.util.ArrayList;
15+
import java.util.Collection;
1416
import java.util.HashMap;
1517
import java.util.List;
1618
import java.util.Map;
1719

20+
import static org.opensearch.example.systemingestprocessor.ExampleSystemIngestProcessorPlugin.TRIGGER_SETTING;
1821
import static org.opensearch.plugins.IngestPlugin.SystemIngestPipelineConfigKeys.INDEX_MAPPINGS;
22+
import static org.opensearch.plugins.IngestPlugin.SystemIngestPipelineConfigKeys.INDEX_SETTINGS;
1923
import static org.opensearch.plugins.IngestPlugin.SystemIngestPipelineConfigKeys.INDEX_TEMPLATE_MAPPINGS;
24+
import static org.opensearch.plugins.IngestPlugin.SystemIngestPipelineConfigKeys.INDEX_TEMPLATE_SETTINGS;
2025

2126
/**
2227
* A factory to create the example system ingest processor
@@ -55,17 +60,26 @@ protected ExampleSystemIngestProcessorFactory() {
5560
@Override
5661
protected AbstractBatchingSystemProcessor newProcessor(String tag, String description, Map<String, Object> config) {
5762
final List<Map<String, Object>> mappings = new ArrayList<>();
63+
final List<Settings> settings = new ArrayList<>();
5864
final Object mappingFromIndex = config.get(INDEX_MAPPINGS);
5965
final Object mappingFromTemplates = config.get(INDEX_TEMPLATE_MAPPINGS);
66+
final Object settingsFromIndex = config.get(INDEX_SETTINGS);
67+
final Object settingsFromTemplates = config.get(INDEX_TEMPLATE_SETTINGS);
6068
if (mappingFromTemplates instanceof List) {
6169
mappings.addAll((List<Map<String, Object>>) mappingFromTemplates);
6270
}
6371
if (mappingFromIndex instanceof Map) {
6472
mappings.add((Map<String, Object>) mappingFromIndex);
6573
}
74+
if (settingsFromTemplates instanceof List) {
75+
settings.addAll((Collection<? extends Settings>) settingsFromTemplates);
76+
}
77+
if (settingsFromIndex instanceof Settings) {
78+
settings.add((Settings) settingsFromIndex);
79+
}
6680

6781
// If no config we are not able to create a processor so simply return a null to show no processor created
68-
if (mappings.isEmpty()) {
82+
if (mappings.isEmpty() && settings.isEmpty()) {
6983
return null;
7084
}
7185

@@ -87,6 +101,15 @@ protected AbstractBatchingSystemProcessor newProcessor(String tag, String descri
87101
}
88102
}
89103

104+
// If the trigger setting is configured then use it directly.
105+
// When we rely on the v1 template to create the index there can be multiple settings and the later one can
106+
// override the previous one so we need to loop through all the settings.
107+
for (final Settings setting : settings) {
108+
if (setting.hasValue(TRIGGER_SETTING.getKey())) {
109+
isTriggerFieldFound = TRIGGER_SETTING.get(setting);
110+
}
111+
}
112+
90113
return isTriggerFieldFound ? new ExampleSystemIngestProcessor(tag, description, DEFAULT_BATCH_SIZE) : null;
91114
}
92115

plugins/examples/system-ingest-processor/src/main/java/org/opensearch/example/systemingestprocessor/ExampleSystemIngestProcessorPlugin.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88

99
package org.opensearch.example.systemingestprocessor;
1010

11+
import org.opensearch.common.settings.Setting;
1112
import org.opensearch.ingest.Processor;
1213
import org.opensearch.plugins.IngestPlugin;
1314
import org.opensearch.plugins.Plugin;
1415

16+
import java.util.List;
1517
import java.util.Map;
1618

1719
/**
@@ -23,8 +25,23 @@ public class ExampleSystemIngestProcessorPlugin extends Plugin implements Ingest
2325
*/
2426
public ExampleSystemIngestProcessorPlugin() {}
2527

28+
/**
29+
* A custom index setting which is used to control if we should create the example system ingest processor.
30+
*/
31+
public static final Setting<Boolean> TRIGGER_SETTING = Setting.boolSetting(
32+
"index.example_system_ingest_processor_plugin.trigger_setting",
33+
false,
34+
Setting.Property.IndexScope,
35+
Setting.Property.Dynamic
36+
);
37+
2638
@Override
2739
public Map<String, Processor.Factory> getSystemIngestProcessors(Processor.Parameters parameters) {
2840
return Map.of(ExampleSystemIngestProcessorFactory.TYPE, new ExampleSystemIngestProcessorFactory());
2941
}
42+
43+
@Override
44+
public List<Setting<?>> getSettings() {
45+
return List.of(TRIGGER_SETTING);
46+
}
3047
}

plugins/examples/system-ingest-processor/src/test/java/org/opensearch/example/systemingestprocessor/ExampleSystemIngestProcessorFactoryTests.java

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
package org.opensearch.example.systemingestprocessor;
1010

11+
import org.opensearch.common.settings.Settings;
1112
import org.opensearch.ingest.AbstractBatchingSystemProcessor;
1213
import org.opensearch.test.OpenSearchTestCase;
1314

@@ -18,8 +19,11 @@
1819
import static org.opensearch.example.systemingestprocessor.ExampleSystemIngestProcessorFactory.DOC;
1920
import static org.opensearch.example.systemingestprocessor.ExampleSystemIngestProcessorFactory.PROPERTIES;
2021
import static org.opensearch.example.systemingestprocessor.ExampleSystemIngestProcessorFactory.TRIGGER_FIELD_NAME;
22+
import static org.opensearch.example.systemingestprocessor.ExampleSystemIngestProcessorPlugin.TRIGGER_SETTING;
2123
import static org.opensearch.plugins.IngestPlugin.SystemIngestPipelineConfigKeys.INDEX_MAPPINGS;
24+
import static org.opensearch.plugins.IngestPlugin.SystemIngestPipelineConfigKeys.INDEX_SETTINGS;
2225
import static org.opensearch.plugins.IngestPlugin.SystemIngestPipelineConfigKeys.INDEX_TEMPLATE_MAPPINGS;
26+
import static org.opensearch.plugins.IngestPlugin.SystemIngestPipelineConfigKeys.INDEX_TEMPLATE_SETTINGS;
2327

2428
public class ExampleSystemIngestProcessorFactoryTests extends OpenSearchTestCase {
2529
public void testNewProcessor_whenWithTriggerField_thenReturnProcessor() {
@@ -55,4 +59,37 @@ public void testNewProcessor_whenNoMapping_thenReturnNull() {
5559

5660
assertNull("Should not create an example system ingest processor when the mapping is not found.", processor);
5761
}
62+
63+
public void testNewProcessor_whenWithTriggerSettingFromIndex_thenReturnProcessor() {
64+
final ExampleSystemIngestProcessorFactory factory = new ExampleSystemIngestProcessorFactory();
65+
Settings triggerEnabled = Settings.builder().put(TRIGGER_SETTING.getKey(), true).build();
66+
67+
AbstractBatchingSystemProcessor processor = factory.newProcessor("tag", "description", Map.of(INDEX_SETTINGS, triggerEnabled));
68+
69+
assertNotNull("Should create an example system ingest processor when the trigger_setting is true.", processor);
70+
assertTrue(processor instanceof ExampleSystemIngestProcessor);
71+
}
72+
73+
public void testNewProcessor_whenWithTriggerSettingFromTemplate_thenReturnProcessor() {
74+
final ExampleSystemIngestProcessorFactory factory = new ExampleSystemIngestProcessorFactory();
75+
Settings triggerEnabled = Settings.builder().put(TRIGGER_SETTING.getKey(), true).build();
76+
77+
AbstractBatchingSystemProcessor processor = factory.newProcessor(
78+
"tag",
79+
"description",
80+
Map.of(INDEX_TEMPLATE_SETTINGS, List.of(triggerEnabled))
81+
);
82+
83+
assertNotNull("Should create an example system ingest processor when the trigger_setting is true.", processor);
84+
assertTrue(processor instanceof ExampleSystemIngestProcessor);
85+
}
86+
87+
public void testNewProcessor_whenWithTriggerSettingDisabled_thenReturnProcessor() {
88+
final ExampleSystemIngestProcessorFactory factory = new ExampleSystemIngestProcessorFactory();
89+
Settings triggerDisabled = Settings.builder().put(TRIGGER_SETTING.getKey(), false).build();
90+
91+
AbstractBatchingSystemProcessor processor = factory.newProcessor("tag", "description", Map.of(INDEX_SETTINGS, triggerDisabled));
92+
93+
assertNull("Should not create an example system ingest processor when the trigger_setting is false.", processor);
94+
}
5895
}

plugins/examples/system-ingest-processor/src/test/java/org/opensearch/example/systemingestprocessor/ExampleSystemIngestProcessorPluginTests.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@
1111
import org.opensearch.ingest.Processor;
1212
import org.opensearch.test.OpenSearchTestCase;
1313

14+
import java.util.List;
1415
import java.util.Map;
1516

17+
import static org.opensearch.example.systemingestprocessor.ExampleSystemIngestProcessorPlugin.TRIGGER_SETTING;
1618
import static org.mockito.Mockito.mock;
1719

1820
public class ExampleSystemIngestProcessorPluginTests extends OpenSearchTestCase {
@@ -27,4 +29,8 @@ public void testGetSystemIngestProcessors() {
2729
factories.get(ExampleSystemIngestProcessorFactory.TYPE) instanceof ExampleSystemIngestProcessorFactory
2830
);
2931
}
32+
33+
public void testGetSettings() {
34+
assertEquals(List.of(TRIGGER_SETTING), plugin.getSettings());
35+
}
3036
}

plugins/examples/system-ingest-processor/src/yamlRestTest/resources/rest-api-spec/test/example-system-ingest-processor/20_system_ingest_processor.yml

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,28 @@ teardown:
2929
- match:
3030
_source.field_auto_added_by_system_ingest_processor: "This field is auto added by the example system ingest processor."
3131

32+
---
33+
"Processor injects a field on indexing a doc to existing index when trigger_setting is true":
34+
- do:
35+
indices.create:
36+
index: test-index
37+
body:
38+
settings:
39+
index.example_system_ingest_processor_plugin.trigger_setting: true
40+
- do:
41+
index:
42+
index: test-index
43+
id: 1
44+
body:
45+
system_ingest_processor_trigger_field: "dummy value"
46+
refresh: true
47+
- do:
48+
get:
49+
index: test-index
50+
id: 1
51+
- match:
52+
_source.field_auto_added_by_system_ingest_processor: "This field is auto added by the example system ingest processor."
53+
3254
---
3355
"Processor should not inject a field on indexing a doc to existing index when trigger field is not defined in the index mapping":
3456
- do:
@@ -56,6 +78,7 @@ teardown:
5678
- skip:
5779
features: allowed_warnings
5880
- do:
81+
# test v1 template
5982
indices.put_template:
6083
name: example-template
6184
body:
@@ -79,7 +102,41 @@ teardown:
79102
id: 1
80103
- match:
81104
_source.field_auto_added_by_system_ingest_processor: "This field is auto added by the example system ingest processor."
105+
- do:
106+
indices.delete_template:
107+
name: example-template
108+
---
82109

110+
"Processor injects field when index is created from matching template where trigger_setting is true":
111+
- skip:
112+
features: allowed_warnings
113+
- do:
114+
# test v2 template
115+
indices.put_index_template:
116+
name: example-template
117+
body:
118+
index_patterns: ["template-*"]
119+
template:
120+
settings:
121+
index.example_system_ingest_processor_plugin.trigger_setting: true
122+
- do:
123+
allowed_warnings:
124+
- "index [template-index-1] matches multiple legacy templates [example-template, global], composable templates will only match a single template"
125+
index:
126+
index: template-index-1
127+
id: 1
128+
body:
129+
system_ingest_processor_trigger_field: "dummy value"
130+
refresh: true
131+
- do:
132+
get:
133+
index: template-index-1
134+
id: 1
135+
- match:
136+
_source.field_auto_added_by_system_ingest_processor: "This field is auto added by the example system ingest processor."
137+
- do:
138+
indices.delete_index_template:
139+
name: example-template
83140
---
84141
"Processor injects field on bulk indexing to existing index":
85142
- do:
@@ -156,7 +213,9 @@ teardown:
156213
id: 2
157214
- match:
158215
_source.field_auto_added_by_system_ingest_processor: "This field is auto added by the example system ingest processor."
159-
216+
- do:
217+
indices.delete_template:
218+
name: bulk-template
160219
---
161220
"Processor injects field on bulk update, upsert on existing/new documents":
162221
# Temporarily disable system ingest pipelines to insert without triggering the system ingest field

plugins/repository-azure/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ opensearchplugin {
4444
}
4545

4646
dependencies {
47-
api 'com.azure:azure-core:1.55.3'
47+
api 'com.azure:azure-core:1.55.5'
4848
api 'com.azure:azure-json:1.5.0'
4949
api 'com.azure:azure-xml:1.2.0'
5050
api 'com.azure:azure-storage-common:12.29.0'

plugins/repository-azure/licenses/azure-core-1.55.3.jar.sha1

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)