Skip to content

Commit 4cf8f6e

Browse files
committed
Merge remote-tracking branch 'upstream/main' into index-metadata-mutate
2 parents 98004f8 + 1219c56 commit 4cf8f6e

File tree

171 files changed

+10051
-1643
lines changed

Some content is hidden

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

171 files changed

+10051
-1643
lines changed

.github/workflows/assemble.yml

+2-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
matrix:
1010
java: [ 11, 17, 21 ]
11-
os: [ubuntu-latest, windows-latest, macos-latest]
11+
os: [ubuntu-latest, windows-latest, macos-13]
1212
steps:
1313
- uses: actions/checkout@v4
1414
- name: Set up JDK ${{ matrix.java }}
@@ -18,10 +18,7 @@ jobs:
1818
distribution: temurin
1919
- name: Setup docker (missing on MacOS)
2020
if: runner.os == 'macos'
21-
run: |
22-
brew install docker
23-
colima start
24-
sudo ln -sf $HOME/.colima/default/docker.sock /var/run/docker.sock
21+
uses: douglascamata/setup-docker-macos-action@main
2522
- name: Run Gradle (assemble)
2623
run: |
2724
./gradlew assemble --parallel --no-build-cache -PDISABLE_BUILD_CACHE

.github/workflows/links.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- uses: actions/checkout@v4
1414
- name: lychee Link Checker
1515
id: lychee
16-
uses: lycheeverse/lychee-action@v1.9.3
16+
uses: lycheeverse/lychee-action@v1.10.0
1717
with:
1818
args: --accept=200,403,429 --exclude-mail **/*.html **/*.md **/*.txt **/*.json --exclude-file .lychee.excludes
1919
fail: true

.github/workflows/precommit.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
matrix:
1010
java: [ 11, 17, 21 ]
11-
os: [ubuntu-latest, windows-latest, macos-latest]
11+
os: [ubuntu-latest, windows-latest, macos-13]
1212
steps:
1313
- uses: actions/checkout@v4
1414
- name: Set up JDK ${{ matrix.java }}

CHANGELOG.md

+24
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1111
- Allow setting KEYSTORE_PASSWORD through env variable ([#12865](https://github.com/opensearch-project/OpenSearch/pull/12865))
1212
- [Concurrent Segment Search] Perform buildAggregation concurrently and support Composite Aggregations ([#12697](https://github.com/opensearch-project/OpenSearch/pull/12697))
1313
- [Concurrent Segment Search] Disable concurrent segment search for system indices and throttled requests ([#12954](https://github.com/opensearch-project/OpenSearch/pull/12954))
14+
- Rename ingest processor supports overriding target field if exists ([#12990](https://github.com/opensearch-project/OpenSearch/pull/12990))
1415
- [Tiered Caching] Make took time caching policy setting dynamic ([#13063](https://github.com/opensearch-project/OpenSearch/pull/13063))
1516
- Derived fields support to derive field values at query time without indexing ([#12569](https://github.com/opensearch-project/OpenSearch/pull/12569))
1617
- Detect breaking changes on pull requests ([#9044](https://github.com/opensearch-project/OpenSearch/pull/9044))
@@ -21,8 +22,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
2122
- [Tiered Caching] Add dimension-based stats to ICache implementations. ([#12531](https://github.com/opensearch-project/OpenSearch/pull/12531))
2223
- Add changes for overriding remote store and replication settings during snapshot restore. ([#11868](https://github.com/opensearch-project/OpenSearch/pull/11868))
2324
- Add an individual setting of rate limiter for segment replication ([#12959](https://github.com/opensearch-project/OpenSearch/pull/12959))
25+
- [Tiered Caching] Expose new cache stats API ([#13237](https://github.com/opensearch-project/OpenSearch/pull/13237))
2426
- [Streaming Indexing] Ensure support of the new transport by security plugin ([#13174](https://github.com/opensearch-project/OpenSearch/pull/13174))
2527
- Add cluster setting to dynamically configure the buckets for filter rewrite optimization. ([#13179](https://github.com/opensearch-project/OpenSearch/pull/13179))
28+
- [Tiered Caching] Gate new stats logic behind FeatureFlags.PLUGGABLE_CACHE ([#13238](https://github.com/opensearch-project/OpenSearch/pull/13238))
29+
- [Tiered Caching] Add a dynamic setting to disable/enable disk cache. ([#13373](https://github.com/opensearch-project/OpenSearch/pull/13373))
30+
- [Remote Store] Add capability of doing refresh as determined by the translog ([#12992](https://github.com/opensearch-project/OpenSearch/pull/12992))
31+
- [Batch Ingestion] Add `batch_size` to `_bulk` API. ([#12457](https://github.com/opensearch-project/OpenSearch/issues/12457))
32+
- [Tiered caching] Make Indices Request Cache Stale Key Mgmt Threshold setting dynamic ([#12941](https://github.com/opensearch-project/OpenSearch/pull/12941))
33+
- Batch mode for async fetching shard information in GatewayAllocator for unassigned shards ([#8746](https://github.com/opensearch-project/OpenSearch/pull/8746))
34+
- [Remote Store] Add settings for remote path type and hash algorithm ([#13225](https://github.com/opensearch-project/OpenSearch/pull/13225))
35+
- [Remote Store] Upload remote paths during remote enabled index creation ([#13386](https://github.com/opensearch-project/OpenSearch/pull/13386))
36+
- [Search Pipeline] Handle default pipeline for multiple indices ([#13276](https://github.com/opensearch-project/OpenSearch/pull/13276))
2637

2738
### Dependencies
2839
- Bump `org.apache.commons:commons-configuration2` from 2.10.0 to 2.10.1 ([#12896](https://github.com/opensearch-project/OpenSearch/pull/12896))
@@ -41,6 +52,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
4152
- Update google dependencies in repository-gcs and discovery-gce ([#13213](https://github.com/opensearch-project/OpenSearch/pull/13213))
4253
- Bump `com.google.apis:google-api-services-compute` from v1-rev235-1.25.0 to v1-rev20240407-2.0.0 ([#13333](https://github.com/opensearch-project/OpenSearch/pull/13333))
4354
- Bump `commons-cli:commons-cli` from 1.6.0 to 1.7.0 ([#13331](https://github.com/opensearch-project/OpenSearch/pull/13331))
55+
- Bump `com.github.spullara.mustache.java:compiler` from 0.9.10 to 0.9.11 ([#13329](https://github.com/opensearch-project/OpenSearch/pull/13329))
56+
- Bump `jakarta.enterprise:jakarta.enterprise.cdi-api` from 4.0.1 to 4.1.0 ([#13328](https://github.com/opensearch-project/OpenSearch/pull/13328))
57+
- Bump `com.google.api.grpc:proto-google-iam-v1` from 0.12.0 to 1.33.0 ([#13332](https://github.com/opensearch-project/OpenSearch/pull/13332))
58+
- OpenJDK Update (April 2024 Patch releases), update to Eclipse Temurin 21.0.3+9 ([#13389](https://github.com/opensearch-project/OpenSearch/pull/13389))
59+
- Bump `com.squareup.okio:okio` from 3.8.0 to 3.9.0 ([#12997](https://github.com/opensearch-project/OpenSearch/pull/12997))
60+
- Bump `com.netflix.nebula.ospackage-base` from 11.8.1 to 11.9.0 ([#13440](https://github.com/opensearch-project/OpenSearch/pull/13440))
61+
- Bump `org.bouncycastle:bc-fips` from 1.0.2.4 to 1.0.2.5 ([#13446](https://github.com/opensearch-project/OpenSearch/pull/13446))
62+
- Bump `lycheeverse/lychee-action` from 1.9.3 to 1.10.0 ([#13447](https://github.com/opensearch-project/OpenSearch/pull/13447))
63+
- Bump `org.gradle.test-retry` from 1.5.8 to 1.5.9 ([#13442](https://github.com/opensearch-project/OpenSearch/pull/13442))
4464

4565
### Changed
4666
- [BWC and API enforcement] Enforcing the presence of API annotations at build time ([#12872](https://github.com/opensearch-project/OpenSearch/pull/12872))
@@ -49,6 +69,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
4969
- Ignoring unavailable shards during search request execution with ignore_available parameter ([#13298](https://github.com/opensearch-project/OpenSearch/pull/13298))
5070
- Refactoring globMatch using simpleMatchWithNormalizedStrings from Regex ([#13104](https://github.com/opensearch-project/OpenSearch/pull/13104))
5171
- [BWC and API enforcement] Reconsider the breaking changes check policy to detect breaking changes against released versions ([#13292](https://github.com/opensearch-project/OpenSearch/pull/13292))
72+
- Switch to macos-13 runner for precommit and assemble github actions due to macos-latest is now arm64 ([#13412](https://github.com/opensearch-project/OpenSearch/pull/13412))
5273

5374
### Deprecated
5475

@@ -60,11 +81,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6081
- Fix issue with feature flags where default value may not be honored ([#12849](https://github.com/opensearch-project/OpenSearch/pull/12849))
6182
- Fix UOE While building Exists query for nested search_as_you_type field ([#12048](https://github.com/opensearch-project/OpenSearch/pull/12048))
6283
- Client with Java 8 runtime and Apache HttpClient 5 Transport fails with java.lang.NoSuchMethodError: java.nio.ByteBuffer.flip()Ljava/nio/ByteBuffer ([#13100](https://github.com/opensearch-project/opensearch-java/pull/13100))
84+
- Fix from and size parameter can be negative when searching ([#13047](https://github.com/opensearch-project/OpenSearch/pull/13047))
6385
- Enabled mockTelemetryPlugin for IT and fixed OOM issues ([#13054](https://github.com/opensearch-project/OpenSearch/pull/13054))
6486
- Fix implement mark() and markSupported() in class FilterStreamInput ([#13098](https://github.com/opensearch-project/OpenSearch/pull/13098))
87+
- Fix IndicesRequestCache Stale calculation ([#13070](https://github.com/opensearch-project/OpenSearch/pull/13070)]
6588
- Fix snapshot _status API to return correct status for partial snapshots ([#12812](https://github.com/opensearch-project/OpenSearch/pull/12812))
6689
- Improve the error messages for _stats with closed indices ([#13012](https://github.com/opensearch-project/OpenSearch/pull/13012))
6790
- Ignore BaseRestHandler unconsumed content check as it's always consumed. ([#13290](https://github.com/opensearch-project/OpenSearch/pull/13290))
91+
- Fix mapper_parsing_exception when using flat_object fields with names longer than 11 characters ([#13259](https://github.com/opensearch-project/OpenSearch/pull/13259))
6892

6993
### Security
7094

CONTRIBUTING.md

+11
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- [Changelog](#changelog)
1010
- [Review Process](#review-process)
1111
- [Tips for Success](#tips)
12+
- [Troubleshooting Failing Builds](#troubleshooting-failing-builds)
1213

1314
# Contributing to OpenSearch
1415

@@ -180,3 +181,13 @@ We have a lot of mechanisms to help expedite towards an accepted PR. Here are so
180181

181182
In general, adding more guardrails to your changes increases the likelihood of swift PR acceptance. We can always relax these guard rails in smaller followup PRs. Reverting a GA feature is much more difficult. Check out the [DEVELOPER_GUIDE](./DEVELOPER_GUIDE.md#submitting-changes) for more useful tips.
182183

184+
## Troubleshooting Failing Builds
185+
186+
The OpenSearch testing framework offers many capabilities but exhibits significant complexity (it does lot of randomization internally to cover as many edge cases and variations as possible). Unfortunately, this posses a challenge by making it harder to discover important issues/bugs in straightforward way and may lead to so called flaky tests - the tests which flip randomly from success to failure without any code changes.
187+
188+
If your pull request reports a failing test(s) on one of the checks, please:
189+
- look if there is an existing [issue](https://github.com/opensearch-project/OpenSearch/issues) reported for the test in question
190+
- if not, please make sure this is not caused by your changes, run the failing test(s) locally for some time
191+
- if you are sure the failure is not related, please open a new [bug](https://github.com/opensearch-project/OpenSearch/issues/new?assignees=&labels=bug%2C+untriaged&projects=&template=bug_template.md&title=%5BBUG%5D) with `flaky-test` label
192+
- add a comment referencing the issue(s) or bug report(s) to your pull request explaining the failing build(s)
193+
- as a bonus point, try to contribute by fixing the flaky test(s)

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ plugins {
5555
id 'opensearch.docker-support'
5656
id 'opensearch.global-build-info'
5757
id "com.diffplug.spotless" version "6.25.0" apply false
58-
id "org.gradle.test-retry" version "1.5.8" apply false
58+
id "org.gradle.test-retry" version "1.5.9" apply false
5959
id "test-report-aggregation"
6060
id 'jacoco-report-aggregation'
6161
}

buildSrc/src/main/java/org/opensearch/gradle/test/DistroTestPlugin.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@
7777
import java.util.stream.Stream;
7878

7979
public class DistroTestPlugin implements Plugin<Project> {
80-
private static final String SYSTEM_JDK_VERSION = "21.0.2+13";
80+
private static final String SYSTEM_JDK_VERSION = "21.0.3+9";
8181
private static final String SYSTEM_JDK_VENDOR = "adoptium";
82-
private static final String GRADLE_JDK_VERSION = "21.0.2+13";
82+
private static final String GRADLE_JDK_VERSION = "21.0.3+9";
8383
private static final String GRADLE_JDK_VENDOR = "adoptium";
8484

8585
// all distributions used by distro tests. this is temporary until tests are per distribution

buildSrc/version.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ opensearch = 3.0.0
22
lucene = 9.11.0-snapshot-fb97840
33

44
bundled_jdk_vendor = adoptium
5-
bundled_jdk = 21.0.2+13
5+
bundled_jdk = 21.0.3+9
66

77
# optional dependencies
88
spatial4j = 0.7

distribution/packages/build.gradle

+1-1
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.8.1"
66+
id "com.netflix.nebula.ospackage-base" version "11.9.0"
6767
}
6868

6969
void addProcessFilesTask(String type, boolean jdk) {

distribution/tools/plugin-cli/build.gradle

+1-1
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.4"
41+
api "org.bouncycastle:bc-fips:1.0.2.5"
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.4.jar.sha1

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
704e65f7e4fe679e5ab2aa8a840f27f8ced4c522

libs/core/src/main/java/org/opensearch/core/common/io/stream/StreamInput.java

+39-1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
import java.util.Arrays;
8181
import java.util.Collection;
8282
import java.util.Collections;
83+
import java.util.Comparator;
8384
import java.util.Date;
8485
import java.util.EnumSet;
8586
import java.util.HashMap;
@@ -90,6 +91,8 @@
9091
import java.util.Locale;
9192
import java.util.Map;
9293
import java.util.Set;
94+
import java.util.SortedMap;
95+
import java.util.TreeMap;
9396
import java.util.concurrent.TimeUnit;
9497
import java.util.function.IntFunction;
9598

@@ -642,12 +645,47 @@ public <K, V> Map<K, V> readMap(Writeable.Reader<K> keyReader, Writeable.Reader<
642645
return Collections.emptyMap();
643646
}
644647
Map<K, V> map = new HashMap<>(size);
648+
readIntoMap(keyReader, valueReader, map, size);
649+
return map;
650+
}
651+
652+
/**
653+
* Read a serialized map into a SortedMap using the default ordering for the keys. If the result is empty it might be immutable.
654+
*/
655+
public <K extends Comparable<K>, V> SortedMap<K, V> readOrderedMap(Writeable.Reader<K> keyReader, Writeable.Reader<V> valueReader)
656+
throws IOException {
657+
return readOrderedMap(keyReader, valueReader, null);
658+
}
659+
660+
/**
661+
* Read a serialized map into a SortedMap, specifying a Comparator for the keys. If the result is empty it might be immutable.
662+
*/
663+
public <K extends Comparable<K>, V> SortedMap<K, V> readOrderedMap(
664+
Writeable.Reader<K> keyReader,
665+
Writeable.Reader<V> valueReader,
666+
@Nullable Comparator<K> keyComparator
667+
) throws IOException {
668+
int size = readArraySize();
669+
if (size == 0) {
670+
return Collections.emptySortedMap();
671+
}
672+
SortedMap<K, V> sortedMap;
673+
if (keyComparator == null) {
674+
sortedMap = new TreeMap<>();
675+
} else {
676+
sortedMap = new TreeMap<>(keyComparator);
677+
}
678+
readIntoMap(keyReader, valueReader, sortedMap, size);
679+
return sortedMap;
680+
}
681+
682+
private <K, V> void readIntoMap(Writeable.Reader<K> keyReader, Writeable.Reader<V> valueReader, Map<K, V> map, int size)
683+
throws IOException {
645684
for (int i = 0; i < size; i++) {
646685
K key = keyReader.read(this);
647686
V value = valueReader.read(this);
648687
map.put(key, value);
649688
}
650-
return map;
651689
}
652690

653691
/**

0 commit comments

Comments
 (0)