Skip to content

Commit 9194a9f

Browse files
committed
Merge origin/main into vshards_p2
Signed-off-by: Atri Sharma <atri.jiit@gmail.com>
2 parents d737bf4 + 6562711 commit 9194a9f

File tree

183 files changed

+18150
-341
lines changed

Some content is hidden

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

183 files changed

+18150
-341
lines changed

.ci/bwcVersions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ BWC_VERSION:
4848
- "2.19.3"
4949
- "2.19.4"
5050
- "2.19.5"
51+
- "2.19.6"
5152
- "3.0.0"
5253
- "3.1.0"
5354
- "3.2.0"

.github/workflows/links.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- uses: actions/checkout@v6
1414
- name: lychee Link Checker
1515
id: lychee
16-
uses: lycheeverse/lychee-action@v2.7.0
16+
uses: lycheeverse/lychee-action@v2.8.0
1717
with:
1818
args: --accept=200,403,429 --exclude-mail **/*.html **/*.md **/*.txt **/*.json --exclude-file .lychee.excludes
1919
fail: true

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
2121
- WLM group custom search settings - groundwork and timeout ([#20536](https://github.com/opensearch-project/OpenSearch/issues/20536))
2222
- Expose JVM runtime metrics via telemetry framework ([#20844](https://github.com/opensearch-project/OpenSearch/pull/20844))
2323
- Add intra segment support for single-value metric aggregations ([#20503](https://github.com/opensearch-project/OpenSearch/pull/20503))
24+
- Add support for enabling pluggable data formats, starting with phase-1 of decoupling shard from engine, and introducing basic abstractions ([#20675](https://github.com/opensearch-project/OpenSearch/pull/20675))
2425

2526
### Changed
2627
- Make telemetry `Tags` immutable ([#20788](https://github.com/opensearch-project/OpenSearch/pull/20788))
2728
- Move Randomness from server to libs/common ([#20570](https://github.com/opensearch-project/OpenSearch/pull/20570))
2829
- Use env variable (OPENSEARCH_FIPS_MODE) to enable opensearch to run in FIPS enforced mode instead of checking for existence of bcFIPS jars ([#20625](https://github.com/opensearch-project/OpenSearch/pull/20625))
2930
- Update streaming flag to use search request context ([#20530](https://github.com/opensearch-project/OpenSearch/pull/20530))
3031
- Move pull-based ingestion classes from experimental to publicAPI ([#20704](https://github.com/opensearch-project/OpenSearch/pull/20704))
32+
- Disable concurrent search for filter duplicates in significant_text ([#20857](https://github.com/opensearch-project/OpenSearch/pull/20857))
3133

3234
### Fixed
35+
- Relax index template pattern overlap check to use minimum-string heuristic, allowing distinguishable multi-wildcard patterns at the same priority ([#20702](https://github.com/opensearch-project/OpenSearch/pull/20702))
3336
- Fix `AutoForceMergeMetrics` silently dropping tags due to unreassigned `addTag()` return value ([#20788](https://github.com/opensearch-project/OpenSearch/pull/20788))
3437
- Fix flaky test failures in ShardsLimitAllocationDeciderIT ([#20375](https://github.com/opensearch-project/OpenSearch/pull/20375))
3538
- Prevent criteria update for context aware indices ([#20250](https://github.com/opensearch-project/OpenSearch/pull/20250))
@@ -50,6 +53,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5053
- Fix ShardSearchFailure in transport-grpc ([#20641](https://github.com/opensearch-project/OpenSearch/pull/20641))
5154
- Fix TLS cert hot-reload for Arrow Flight transport ([#20732](https://github.com/opensearch-project/OpenSearch/pull/20732))
5255
- Fix misleading heap usage cancellation message in SearchBackpressureService ([#20779](https://github.com/opensearch-project/OpenSearch/pull/20779))
56+
- Fix task details JSON logs with nested JSON in metadata are not properly escaped ([#20802](https://github.com/opensearch-project/OpenSearch/pull/20802))
5357
- Delegate getMin/getMax methods for ExitableTerms ([#20775](https://github.com/opensearch-project/OpenSearch/pull/20775))
5458
- Fix terms lookup subquery fetch limit reading from non-existent index setting instead of cluster `max_clause_count` ([#20823](https://github.com/opensearch-project/OpenSearch/pull/20823))
5559
- Fix array_index_out_of_bounds_exception with wildcard and aggregations ([#20842](https://github.com/opensearch-project/OpenSearch/pull/20842))
@@ -74,6 +78,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
7478
- Bump `org.jline:jline` from 3.30.6 to 4.0.0 ([#20800](https://github.com/opensearch-project/OpenSearch/pull/20800))
7579
- Bump `com.netflix.nebula.ospackage-base` from 12.2.0 to 12.3.0 ([#20799](https://github.com/opensearch-project/OpenSearch/pull/20799))
7680
- Bump `com.netflix.nebula:gradle-info-plugin` to 16.2.1 ([#20825](https://github.com/opensearch-project/OpenSearch/pull/20825))
81+
- Bump `lycheeverse/lychee-action` from 2.7.0 to 2.8.0 ([#20888](https://github.com/opensearch-project/OpenSearch/pull/20888))
7782

7883
### Removed
7984

buildSrc/src/main/java/org/opensearch/gradle/internal/InternalDistributionBwcSetupPlugin.java

Lines changed: 86 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ private void configureBwcProject(Project project, BwcVersions.UnreleasedVersionI
106106
bwcVersion,
107107
distributionProject.name,
108108
distributionProject.getProjectPath(),
109-
distributionProject.getDistFile(),
109+
distributionProject,
110110
buildBwcTaskProvider
111111
);
112112

@@ -131,14 +131,24 @@ private void registerBwcArtifacts(Project bwcProject, DistributionProject distri
131131
}
132132

133133
private void registerDistributionArchiveArtifact(Project bwcProject, DistributionProject distributionProject, String buildBwcTask) {
134-
String artifactFileName = distributionProject.getDistFile().getName();
134+
String artifactFileName = distributionProject.getExpectedDistFile().getName();
135135
String artifactName = "opensearch";
136136

137137
String suffix = artifactFileName.endsWith("tar.gz") ? "tar.gz" : artifactFileName.substring(artifactFileName.length() - 3);
138138
int archIndex = artifactFileName.indexOf("x64");
139139

140+
Provider<File> artifactFileProvider = providerFactory.provider(() -> {
141+
if (distributionProject.getExpectedDistFile().exists()) {
142+
return distributionProject.getExpectedDistFile();
143+
} else if (distributionProject.getFallbackDistFile().exists()) {
144+
return distributionProject.getFallbackDistFile();
145+
}
146+
// File doesn't exist, validation will fail elsewhere but we must return a File here
147+
return distributionProject.getExpectedDistFile();
148+
});
149+
140150
bwcProject.getConfigurations().create(distributionProject.name);
141-
bwcProject.getArtifacts().add(distributionProject.name, distributionProject.getDistFile(), artifact -> {
151+
bwcProject.getArtifacts().add(distributionProject.name, artifactFileProvider, artifact -> {
142152
artifact.setName(artifactName);
143153
artifact.builtBy(buildBwcTask);
144154
artifact.setType(suffix);
@@ -152,6 +162,10 @@ private void registerDistributionArchiveArtifact(Project bwcProject, Distributio
152162
});
153163
}
154164

165+
static Version nextPatchVersion(Version version) {
166+
return new Version(version.getMajor(), version.getMinor(), version.getRevision() + 1);
167+
}
168+
155169
private static List<DistributionProject> resolveArchiveProjects(File checkoutDir, Version bwcVersion) {
156170
List<String> projects = new ArrayList<>();
157171
// All active BWC branches publish rpm and deb packages
@@ -174,6 +188,8 @@ private static List<DistributionProject> resolveArchiveProjects(File checkoutDir
174188
projects.addAll(asList("zip", "tar"));
175189
}
176190

191+
Version fallbackVersion = nextPatchVersion(bwcVersion);
192+
177193
return projects.stream().map(name -> {
178194
String baseDir = "distribution" + (name.endsWith("zip") || name.endsWith("tar") ? "/archives" : "/packages");
179195
String classifier = "";
@@ -199,7 +215,7 @@ private static List<DistributionProject> resolveArchiveProjects(File checkoutDir
199215
} else {
200216
extension = name.substring(4);
201217
}
202-
return new DistributionProject(name, baseDir, bwcVersion, classifier, extension, checkoutDir);
218+
return new DistributionProject(name, baseDir, bwcVersion, fallbackVersion, classifier, extension, checkoutDir);
203219
}).collect(Collectors.toList());
204220
}
205221

@@ -215,15 +231,15 @@ static void createBuildBwcTask(
215231
Provider<Version> bwcVersion,
216232
String projectName,
217233
String projectPath,
218-
File projectArtifact,
234+
DistributionProject distributionProject,
219235
TaskProvider<Task> bwcTaskProvider
220236
) {
221237
String bwcTaskName = buildBwcTaskName(projectName);
222238
bwcSetupExtension.bwcTask(bwcTaskName, new Action<LoggedExec>() {
223239
@Override
224240
public void execute(LoggedExec c) {
225241
c.getInputs().file(new File(project.getBuildDir(), "refspec"));
226-
c.getOutputs().files(projectArtifact);
242+
c.getOutputs().files(distributionProject.getExpectedDistFile(), distributionProject.getFallbackDistFile());
227243
c.getOutputs().cacheIf("BWC distribution caching is disabled on 'master' branch", task -> {
228244
String gitBranch = System.getenv("GIT_BRANCH");
229245
return BuildParams.isCi() && (gitBranch == null || gitBranch.endsWith("master") == false);
@@ -235,9 +251,24 @@ public void execute(LoggedExec c) {
235251
c.doLast(new Action<Task>() {
236252
@Override
237253
public void execute(Task task) {
238-
if (projectArtifact.exists() == false) {
254+
if (distributionProject.getExpectedDistFile().exists() == false
255+
&& distributionProject.getFallbackDistFile().exists()) {
256+
project.getLogger()
257+
.warn(
258+
"BWC branch produced {} instead of {}. "
259+
+ "Version.java on main may need updating to include version {}.",
260+
distributionProject.getFallbackDistFile().getName(),
261+
distributionProject.getExpectedDistFile().getName(),
262+
distributionProject.getFallbackVersion()
263+
);
264+
} else if (distributionProject.getExpectedDistFile().exists() == false) {
239265
throw new InvalidUserDataException(
240-
"Building " + bwcVersion.get() + " didn't generate expected file " + projectArtifact
266+
"Building "
267+
+ bwcVersion.get()
268+
+ " didn't generate expected file "
269+
+ distributionProject.getExpectedDistFile()
270+
+ " or fallback "
271+
+ distributionProject.getFallbackDistFile()
241272
);
242273
}
243274
}
@@ -251,20 +282,48 @@ public void execute(Task task) {
251282
* Represents an archive project (distribution/archives/*)
252283
* we build from a bwc Version in a cloned repository
253284
*/
254-
private static class DistributionProject {
255-
private final String name;
256-
private String projectPath;
257-
private File distFile;
258-
private File expandedDistDir;
259-
260-
DistributionProject(String name, String baseDir, Version version, String classifier, String extension, File checkoutDir) {
285+
static class DistributionProject {
286+
final String name;
287+
private final String projectPath;
288+
private final File expectedDistFile;
289+
private final File fallbackDistFile;
290+
private final Version fallbackVersion;
291+
private final File expandedDistDir;
292+
293+
DistributionProject(
294+
String name,
295+
String baseDir,
296+
Version expectedVersion,
297+
Version fallbackVersion,
298+
String classifier,
299+
String extension,
300+
File checkoutDir
301+
) {
261302
this.name = name;
262303
this.projectPath = baseDir + "/" + name;
304+
this.expectedDistFile = buildDistFile(name, baseDir, expectedVersion, classifier, extension, checkoutDir);
305+
this.fallbackDistFile = buildDistFile(name, baseDir, fallbackVersion, classifier, extension, checkoutDir);
306+
this.fallbackVersion = fallbackVersion;
307+
if (name.endsWith("zip") || name.endsWith("tar")) {
308+
this.expandedDistDir = new File(checkoutDir, baseDir + "/" + name + "/build/install");
309+
} else {
310+
this.expandedDistDir = null;
311+
}
312+
}
313+
314+
private static File buildDistFile(
315+
String name,
316+
String baseDir,
317+
Version version,
318+
String classifier,
319+
String extension,
320+
File checkoutDir
321+
) {
263322
if (version.onOrAfter("1.1.0")) {
264323
// Deb uses underscores (I don't know why...):
265324
// https://github.com/opensearch-project/OpenSearch/blob/f6d9a86f0e2e8241fd58b7e8b6cdeaf931b5108f/distribution/packages/build.gradle#L139
266325
final String separator = name.equals("deb") ? "_" : "-";
267-
this.distFile = new File(
326+
return new File(
268327
checkoutDir,
269328
baseDir
270329
+ "/"
@@ -278,23 +337,27 @@ private static class DistributionProject {
278337
+ extension
279338
);
280339
} else {
281-
this.distFile = new File(
340+
return new File(
282341
checkoutDir,
283342
baseDir + "/" + name + "/build/distributions/opensearch-" + version + "-SNAPSHOT" + classifier + "." + extension
284343
);
285344
}
286-
// we only ported this down to the 7.x branch.
287-
if (version.onOrAfter("7.10.0") && (name.endsWith("zip") || name.endsWith("tar"))) {
288-
this.expandedDistDir = new File(checkoutDir, baseDir + "/" + name + "/build/install");
289-
}
290345
}
291346

292347
public String getProjectPath() {
293348
return projectPath;
294349
}
295350

296-
public File getDistFile() {
297-
return distFile;
351+
public File getExpectedDistFile() {
352+
return expectedDistFile;
353+
}
354+
355+
public File getFallbackDistFile() {
356+
return fallbackDistFile;
357+
}
358+
359+
public Version getFallbackVersion() {
360+
return fallbackVersion;
298361
}
299362

300363
public File getExpandedDistDirectory() {

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ public class Version implements Comparable<Version>, ToXContentFragment {
127127
public static final Version V_2_19_3 = new Version(2190399, org.apache.lucene.util.Version.LUCENE_9_12_2);
128128
public static final Version V_2_19_4 = new Version(2190499, org.apache.lucene.util.Version.LUCENE_9_12_3);
129129
public static final Version V_2_19_5 = new Version(2190599, org.apache.lucene.util.Version.LUCENE_9_12_3);
130+
public static final Version V_2_19_6 = new Version(2190699, org.apache.lucene.util.Version.LUCENE_9_12_3);
130131
public static final Version V_3_0_0 = new Version(3000099, org.apache.lucene.util.Version.LUCENE_10_1_0);
131132
public static final Version V_3_1_0 = new Version(3010099, org.apache.lucene.util.Version.LUCENE_10_2_1);
132133
public static final Version V_3_2_0 = new Version(3020099, org.apache.lucene.util.Version.LUCENE_10_2_2);
@@ -135,6 +136,7 @@ public class Version implements Comparable<Version>, ToXContentFragment {
135136
public static final Version V_3_3_2 = new Version(3030299, org.apache.lucene.util.Version.LUCENE_10_3_1);
136137
public static final Version V_3_4_0 = new Version(3040099, org.apache.lucene.util.Version.LUCENE_10_3_2);
137138
public static final Version V_3_5_0 = new Version(3050099, org.apache.lucene.util.Version.LUCENE_10_3_2);
139+
public static final Version V_3_5_1 = new Version(3050199, org.apache.lucene.util.Version.LUCENE_10_3_2);
138140
public static final Version V_3_6_0 = new Version(3060099, org.apache.lucene.util.Version.LUCENE_10_4_0);
139141
public static final Version CURRENT = V_3_6_0;
140142

qa/logging-config/src/test/java/org/opensearch/common/logging/OpenSearchJsonLayoutTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ public void testLayoutWithAdditionalFields() {
122122
"\"cluster.name\": \"${sys:opensearch.logs.cluster_name}\", " +
123123
"\"node.name\": \"%node_name\", " +
124124
"\"message\": \"%notEmpty{%enc{%marker}{JSON} }%enc{%.-10000m}{JSON}\"" +
125-
"%notEmpty{, \"x-opaque-id\": \"%OpenSearchMessageField{x-opaque-id}\"}" +
126-
"%notEmpty{, \"someOtherField\": \"%OpenSearchMessageField{someOtherField}\"}" +
125+
"%notEmpty{, \"x-opaque-id\": \"%enc{%OpenSearchMessageField{x-opaque-id}}{JSON}\"}" +
126+
"%notEmpty{, \"someOtherField\": \"%enc{%OpenSearchMessageField{someOtherField}}{JSON}\"}" +
127127
"%notEmpty{, %node_and_cluster_id }" +
128128
"%exceptionAsJson }" + System.lineSeparator()));
129129
}
@@ -143,7 +143,7 @@ public void testLayoutWithAdditionalFieldOverride() {
143143
"\"component\": \"%c{1.}\", " +
144144
"\"cluster.name\": \"${sys:opensearch.logs.cluster_name}\", " +
145145
"\"node.name\": \"%node_name\"" +
146-
"%notEmpty{, \"message\": \"%OpenSearchMessageField{message}\"}" +
146+
"%notEmpty{, \"message\": \"%enc{%OpenSearchMessageField{message}}{JSON}\"}" +
147147
"%notEmpty{, %node_and_cluster_id }" +
148148
"%exceptionAsJson }" + System.lineSeparator()));
149149
}

rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_index_template/10_basic.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,51 @@
102102
number_of_shards: 1
103103
number_of_replicas: 0
104104

105+
---
106+
"Put distinguishable multi-wildcard templates at the same priority":
107+
- skip:
108+
features: allowed_warnings
109+
version: " - 3.5.99"
110+
reason: "template overlap check was relaxed in 3.6"
111+
112+
- do:
113+
allowed_warnings:
114+
- "index template [app-test-some] has index patterns [app-test-*-some-*] matching patterns from existing older templates [global] with patterns (global => [*]); this template [app-test-some] will take precedence during new index creation"
115+
indices.put_index_template:
116+
name: app-test-some
117+
body:
118+
index_patterns: ["app-test-*-some-*"]
119+
priority: 0
120+
121+
# The second template has a literal segment after the first wildcard that differs from the first
122+
# template (-some_other- vs -some-), so the two patterns do not practically overlap and both
123+
# templates should be accepted at the same priority.
124+
- do:
125+
allowed_warnings:
126+
- "index template [app-test-some-other] has index patterns [app-test-*-some_other-*] matching patterns from existing older templates [global] with patterns (global => [*]); this template [app-test-some-other] will take precedence during new index creation"
127+
indices.put_index_template:
128+
name: app-test-some-other
129+
body:
130+
index_patterns: ["app-test-*-some_other-*"]
131+
priority: 0
132+
133+
- do:
134+
indices.get_index_template:
135+
name: app-test-some
136+
- match: {index_templates.0.index_template.index_patterns: ["app-test-*-some-*"]}
137+
138+
- do:
139+
indices.get_index_template:
140+
name: app-test-some-other
141+
- match: {index_templates.0.index_template.index_patterns: ["app-test-*-some_other-*"]}
142+
143+
- do:
144+
indices.delete_index_template:
145+
name: app-test-some
146+
- do:
147+
indices.delete_index_template:
148+
name: app-test-some-other
149+
105150
---
106151
"Put index template without index_patterns":
107152

0 commit comments

Comments
 (0)