Skip to content

Commit

Permalink
Merge branch 'opensearch-project:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
shiv0408 authored Oct 26, 2023
2 parents 6f3b3ca + 746ca09 commit af15b47
Show file tree
Hide file tree
Showing 181 changed files with 4,733 additions and 1,079 deletions.
1 change: 1 addition & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Resolves #[Issue number to be closed when this PR is merged]
- [ ] All tests pass
- [ ] New functionality has been documented.
- [ ] New functionality has javadoc added
- [ ] Failing checks are inspected and point to the corresponding known issue(s) (See: [Troubleshooting Failing Builds](../blob/main/CONTRIBUTING.md#troubleshooting-failing-builds))
- [ ] Commits are signed per the DCO using --signoff
- [ ] Commit changes are listed out in CHANGELOG.md file (See: [Changelog](../blob/main/CONTRIBUTING.md#changelog))
- [ ] Public documentation issue/PR [created](https://github.com/opensearch-project/documentation-website/issues/new/choose)
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/pull-request-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Pull Request Checks

on:
pull_request:
types:
[
opened,
edited,
review_requested,
synchronize,
reopened,
ready_for_review,
]

jobs:
verify-description-checklist:
name: Verify Description Checklist
runs-on: ubuntu-latest
steps:
- uses: peternied/check-pull-request-description-checklist@v1
with:
checklist-items: |
New functionality includes testing.
All tests pass
New functionality has been documented.
New functionality has javadoc added
Commits are signed per the DCO using --signoff
Commit changes are listed out in CHANGELOG.md file (See: [Changelog](../blob/main/CONTRIBUTING.md#changelog))
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- [Remote cluster state] Upload global metadata in cluster state to remote store([#10404](https://github.com/opensearch-project/OpenSearch/pull/10404))
- [Remote cluster state] Download functionality of global metadata from remote store ([#10535](https://github.com/opensearch-project/OpenSearch/pull/10535))
- [Remote cluster state] Restore global metadata from remote store when local state is lost after quorum loss ([#10404](https://github.com/opensearch-project/OpenSearch/pull/10404))
- [AdmissionControl] Added changes for AdmissionControl Interceptor and AdmissionControlService for RateLimiting ([#9286](https://github.com/opensearch-project/OpenSearch/pull/9286))
- GHA to verify checklist items completion in PR descriptions ([#10800](https://github.com/opensearch-project/OpenSearch/pull/10800))

### Dependencies
- Bump `log4j-core` from 2.18.0 to 2.19.0
Expand Down Expand Up @@ -93,6 +95,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- [Remote Store] Add repository stats for remote store([#10567](https://github.com/opensearch-project/OpenSearch/pull/10567))
- Add search query categorizer ([#10255](https://github.com/opensearch-project/OpenSearch/pull/10255))
- Introduce ConcurrentQueryProfiler to profile query using concurrent segment search path and support concurrency during rewrite and create weight ([10352](https://github.com/opensearch-project/OpenSearch/pull/10352))
- [Remote cluster state] Make index and global metadata upload timeout dynamic cluster settings ([#10814](https://github.com/opensearch-project/OpenSearch/pull/10814))
- Added cluster setting cluster.restrict.index.replication_type to restrict setting of index setting replication type ([#10866](https://github.com/opensearch-project/OpenSearch/pull/10866))
- Add cluster state stats ([#10670](https://github.com/opensearch-project/OpenSearch/pull/10670))

### Dependencies
- Bump `com.google.api.grpc:proto-google-common-protos` from 2.10.0 to 2.25.1 ([#10208](https://github.com/opensearch-project/OpenSearch/pull/10208), [#10298](https://github.com/opensearch-project/OpenSearch/pull/10298))
Expand All @@ -105,6 +110,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Bump `org.codehaus.woodstox:stax2-api` from 4.2.1 to 4.2.2 ([#10639](https://github.com/opensearch-project/OpenSearch/pull/10639))
- Bump `com.google.http-client:google-http-client` from 1.43.2 to 1.43.3 ([#10635](https://github.com/opensearch-project/OpenSearch/pull/10635))
- Bump `com.squareup.okio:okio` from 3.5.0 to 3.6.0 ([#10637](https://github.com/opensearch-project/OpenSearch/pull/10637))
- Bump `org.apache.logging.log4j:log4j-core` from 2.20.0 to 2.21.0 ([#10858](https://github.com/opensearch-project/OpenSearch/pull/10858))

### Changed
- Mute the query profile IT with concurrent execution ([#9840](https://github.com/opensearch-project/OpenSearch/pull/9840))
Expand All @@ -113,6 +119,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- [Remote Store] Add Remote Store backpressure rejection stats to `_nodes/stats` ([#10524](https://github.com/opensearch-project/OpenSearch/pull/10524))
- [BUG] Fix java.lang.SecurityException in repository-gcs plugin ([#10642](https://github.com/opensearch-project/OpenSearch/pull/10642))
- Add telemetry tracer/metric enable flag and integ test. ([#10395](https://github.com/opensearch-project/OpenSearch/pull/10395))
- Add instrumentation for indexing in transport bulk action and transport shard bulk action. ([#10273](https://github.com/opensearch-project/OpenSearch/pull/10273))

### Deprecated

Expand Down
12 changes: 12 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- [Developer Certificate of Origin](#developer-certificate-of-origin)
- [Changelog](#changelog)
- [Review Process](#review-process)
- [Troubleshooting Failing Builds](#troubleshooting-failing-builds)

# Contributing to OpenSearch

Expand Down Expand Up @@ -162,3 +163,14 @@ During the PR process, expect that there will be some back-and-forth. Please try
If we accept the PR, a [maintainer](MAINTAINERS.md) will merge your change and usually take care of backporting it to appropriate branches ourselves.

If we reject the PR, we will close the pull request with a comment explaining why. This decision isn't always final: if you feel we have misunderstood your intended change or otherwise think that we should reconsider then please continue the conversation with a comment on the PR and we'll do our best to address any further points you raise.

## Troubleshooting Failing Builds

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.

If your pull request reports a failing test(s) on one of the checks, please:
- look if there is an existing [issue](https://github.com/opensearch-project/OpenSearch/issues) reported for the test in question
- if not, please make sure this is not caused by your changes, run the failing test(s) locally for some time
- 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
- add a comment referencing the issue(s) or bug report(s) to your pull request explaining the failing build(s)
- as a bonus point, try to contribute by fixing the flaky test(s)
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ plugins {
repositories {
mavenCentral()
}

dependencies {
implementation "org.apache.logging.log4j:log4j-core:2.20.0"
implementation "org.apache.logging.log4j:log4j-core:2.21.0"
}

["0.0.1", "0.0.2"].forEach { v ->
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/version.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jackson_databind = 2.15.2
snakeyaml = 2.1
icu4j = 70.1
supercsv = 2.4.0
log4j = 2.20.0
log4j = 2.21.0
slf4j = 1.7.36
asm = 9.6
jettison = 1.5.4
Expand Down
1 change: 0 additions & 1 deletion libs/core/licenses/log4j-api-2.20.0.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions libs/core/licenses/log4j-api-2.21.0.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
760192f2b69eacf4a4afc78e5a1d7a8de054fcbd
1 change: 0 additions & 1 deletion plugins/crypto-kms/licenses/log4j-1.2-api-2.20.0.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions plugins/crypto-kms/licenses/log4j-1.2-api-2.21.0.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
12bad3819a9570807f3c97315930699584c12152

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
12bad3819a9570807f3c97315930699584c12152

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
12bad3819a9570807f3c97315930699584c12152

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
12bad3819a9570807f3c97315930699584c12152

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
12bad3819a9570807f3c97315930699584c12152

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
911fdb5b1a1df36719c579ecc6f2957b88bce1ab

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
12bad3819a9570807f3c97315930699584c12152
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ protected S3Repository createRepository(
ClusterService clusterService,
RecoverySettings recoverySettings
) {
return new S3Repository(metadata, registry, service, clusterService, recoverySettings, null, null, null, null, false) {
return new S3Repository(metadata, registry, service, clusterService, recoverySettings, null, null, null, null, null, false) {

@Override
public BlobStore blobStore() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class AmazonAsyncS3Reference extends RefCountedReleasable<AmazonAsyncS3Wi
super("AWS_S3_CLIENT", client, () -> {
client.client().close();
client.priorityClient().close();
client.urgentClient().close();
AwsCredentialsProvider credentials = client.credentials();
if (credentials instanceof Closeable) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,19 @@
final class AmazonAsyncS3WithCredentials {
private final S3AsyncClient client;
private final S3AsyncClient priorityClient;
private final S3AsyncClient urgentClient;
private final AwsCredentialsProvider credentials;

private AmazonAsyncS3WithCredentials(
final S3AsyncClient client,
final S3AsyncClient priorityClient,
final S3AsyncClient urgentClient,
@Nullable final AwsCredentialsProvider credentials
) {
this.client = client;
this.credentials = credentials;
this.priorityClient = priorityClient;
this.urgentClient = urgentClient;
}

S3AsyncClient client() {
Expand All @@ -39,15 +42,20 @@ S3AsyncClient priorityClient() {
return priorityClient;
}

S3AsyncClient urgentClient() {
return urgentClient;
}

AwsCredentialsProvider credentials() {
return credentials;
}

static AmazonAsyncS3WithCredentials create(
final S3AsyncClient client,
final S3AsyncClient priorityClient,
final S3AsyncClient urgentClient,
@Nullable final AwsCredentialsProvider credentials
) {
return new AmazonAsyncS3WithCredentials(client, priorityClient, credentials);
return new AmazonAsyncS3WithCredentials(client, priorityClient, urgentClient, credentials);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ public synchronized void refreshAndClearCache(Map<String, S3ClientSettings> clie
*/
public AmazonAsyncS3Reference client(
RepositoryMetadata repositoryMetadata,
AsyncExecutorContainer urgentExecutorBuilder,
AsyncExecutorContainer priorityExecutorBuilder,
AsyncExecutorContainer normalExecutorBuilder
) {
Expand All @@ -119,7 +120,7 @@ public AmazonAsyncS3Reference client(
return existing;
}
final AmazonAsyncS3Reference clientReference = new AmazonAsyncS3Reference(
buildClient(clientSettings, priorityExecutorBuilder, normalExecutorBuilder)
buildClient(clientSettings, urgentExecutorBuilder, priorityExecutorBuilder, normalExecutorBuilder)
);
clientReference.incRef();
clientsCache = MapBuilder.newMapBuilder(clientsCache).put(clientSettings, clientReference).immutableMap();
Expand Down Expand Up @@ -165,6 +166,7 @@ S3ClientSettings settings(RepositoryMetadata repositoryMetadata) {
// proxy for testing
synchronized AmazonAsyncS3WithCredentials buildClient(
final S3ClientSettings clientSettings,
AsyncExecutorContainer urgentExecutorBuilder,
AsyncExecutorContainer priorityExecutorBuilder,
AsyncExecutorContainer normalExecutorBuilder
) {
Expand Down Expand Up @@ -195,6 +197,17 @@ synchronized AmazonAsyncS3WithCredentials buildClient(
builder.forcePathStyle(true);
}

builder.httpClient(buildHttpClient(clientSettings, urgentExecutorBuilder.getAsyncTransferEventLoopGroup()));
builder.asyncConfiguration(
ClientAsyncConfiguration.builder()
.advancedOption(
SdkAdvancedAsyncClientOption.FUTURE_COMPLETION_EXECUTOR,
urgentExecutorBuilder.getFutureCompletionExecutor()
)
.build()
);
final S3AsyncClient urgentClient = SocketAccess.doPrivileged(builder::build);

builder.httpClient(buildHttpClient(clientSettings, priorityExecutorBuilder.getAsyncTransferEventLoopGroup()));
builder.asyncConfiguration(
ClientAsyncConfiguration.builder()
Expand All @@ -217,7 +230,7 @@ synchronized AmazonAsyncS3WithCredentials buildClient(
);
final S3AsyncClient client = SocketAccess.doPrivileged(builder::build);

return AmazonAsyncS3WithCredentials.create(client, priorityClient, credentials);
return AmazonAsyncS3WithCredentials.create(client, priorityClient, urgentClient, credentials);
}

static ClientOverrideConfiguration buildOverrideConfiguration(final S3ClientSettings clientSettings) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,14 @@ public void asyncBlobUpload(WriteContext writeContext, ActionListener<Void> comp
StreamContext streamContext = SocketAccess.doPrivileged(() -> writeContext.getStreamProvider(partSize));
try (AmazonAsyncS3Reference amazonS3Reference = SocketAccess.doPrivileged(blobStore::asyncClientReference)) {

S3AsyncClient s3AsyncClient = writeContext.getWritePriority() == WritePriority.HIGH
? amazonS3Reference.get().priorityClient()
: amazonS3Reference.get().client();
S3AsyncClient s3AsyncClient;
if (writeContext.getWritePriority() == WritePriority.URGENT) {
s3AsyncClient = amazonS3Reference.get().urgentClient();
} else if (writeContext.getWritePriority() == WritePriority.HIGH) {
s3AsyncClient = amazonS3Reference.get().priorityClient();
} else {
s3AsyncClient = amazonS3Reference.get().client();
}
CompletableFuture<Void> completableFuture = blobStore.getAsyncTransferManager()
.uploadObject(s3AsyncClient, uploadRequest, streamContext, blobStore.getStatsMetricPublisher());
completableFuture.whenComplete((response, throwable) -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ class S3BlobStore implements BlobStore {
private final StatsMetricPublisher statsMetricPublisher = new StatsMetricPublisher();

private final AsyncTransferManager asyncTransferManager;
private final AsyncExecutorContainer urgentExecutorBuilder;
private final AsyncExecutorContainer priorityExecutorBuilder;
private final AsyncExecutorContainer normalExecutorBuilder;
private final boolean multipartUploadEnabled;
Expand All @@ -100,6 +101,7 @@ class S3BlobStore implements BlobStore {
int bulkDeletesSize,
RepositoryMetadata repositoryMetadata,
AsyncTransferManager asyncTransferManager,
AsyncExecutorContainer urgentExecutorBuilder,
AsyncExecutorContainer priorityExecutorBuilder,
AsyncExecutorContainer normalExecutorBuilder
) {
Expand All @@ -116,6 +118,7 @@ class S3BlobStore implements BlobStore {
this.asyncTransferManager = asyncTransferManager;
this.normalExecutorBuilder = normalExecutorBuilder;
this.priorityExecutorBuilder = priorityExecutorBuilder;
this.urgentExecutorBuilder = urgentExecutorBuilder;
}

@Override
Expand All @@ -139,7 +142,7 @@ public AmazonS3Reference clientReference() {
}

public AmazonAsyncS3Reference asyncClientReference() {
return s3AsyncService.client(repositoryMetadata, priorityExecutorBuilder, normalExecutorBuilder);
return s3AsyncService.client(repositoryMetadata, urgentExecutorBuilder, priorityExecutorBuilder, normalExecutorBuilder);
}

int getMaxRetries() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ class S3Repository extends MeteredBlobStoreRepository {
private final AsyncTransferManager asyncUploadUtils;
private final S3AsyncService s3AsyncService;
private final boolean multipartUploadEnabled;
private final AsyncExecutorContainer urgentExecutorBuilder;
private final AsyncExecutorContainer priorityExecutorBuilder;
private final AsyncExecutorContainer normalExecutorBuilder;
private final Path pluginConfigPath;
Expand All @@ -248,6 +249,7 @@ class S3Repository extends MeteredBlobStoreRepository {
final ClusterService clusterService,
final RecoverySettings recoverySettings,
final AsyncTransferManager asyncUploadUtils,
final AsyncExecutorContainer urgentExecutorBuilder,
final AsyncExecutorContainer priorityExecutorBuilder,
final AsyncExecutorContainer normalExecutorBuilder,
final S3AsyncService s3AsyncService,
Expand All @@ -260,6 +262,7 @@ class S3Repository extends MeteredBlobStoreRepository {
clusterService,
recoverySettings,
asyncUploadUtils,
urgentExecutorBuilder,
priorityExecutorBuilder,
normalExecutorBuilder,
s3AsyncService,
Expand All @@ -278,6 +281,7 @@ class S3Repository extends MeteredBlobStoreRepository {
final ClusterService clusterService,
final RecoverySettings recoverySettings,
final AsyncTransferManager asyncUploadUtils,
final AsyncExecutorContainer urgentExecutorBuilder,
final AsyncExecutorContainer priorityExecutorBuilder,
final AsyncExecutorContainer normalExecutorBuilder,
final S3AsyncService s3AsyncService,
Expand All @@ -290,6 +294,7 @@ class S3Repository extends MeteredBlobStoreRepository {
this.multipartUploadEnabled = multipartUploadEnabled;
this.pluginConfigPath = pluginConfigPath;
this.asyncUploadUtils = asyncUploadUtils;
this.urgentExecutorBuilder = urgentExecutorBuilder;
this.priorityExecutorBuilder = priorityExecutorBuilder;
this.normalExecutorBuilder = normalExecutorBuilder;

Expand Down Expand Up @@ -352,6 +357,7 @@ protected S3BlobStore createBlobStore() {
bulkDeletesSize,
metadata,
asyncUploadUtils,
urgentExecutorBuilder,
priorityExecutorBuilder,
normalExecutorBuilder
);
Expand Down
Loading

0 comments on commit af15b47

Please sign in to comment.