Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into manager-timeout-clu…
Browse files Browse the repository at this point in the history
…ster-api

Signed-off-by: Tianli Feng <ftianli@amazon.com>
  • Loading branch information
Tianli Feng committed Apr 4, 2022
2 parents 4ce930a + f9ca90e commit 58b30d4
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .ci/bwcVersions
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ BWC_VERSION:
- "1.3.0"
- "1.3.1"
- "1.3.2"
- "1.4.0"
- "2.0.0"
2 changes: 1 addition & 1 deletion buildSrc/version.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
opensearch = 2.0.0
opensearch = 2.1.0
lucene = 9.1.0

bundled_jdk_vendor = adoptium
Expand Down
2 changes: 1 addition & 1 deletion plugins/repository-gcs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ dependencies {
api 'com.google.protobuf:protobuf-java-util:3.19.3'
api 'com.google.protobuf:protobuf-java:3.19.3'
api 'com.google.code.gson:gson:2.9.0'
api 'com.google.api.grpc:proto-google-common-protos:1.16.0'
api 'com.google.api.grpc:proto-google-common-protos:2.8.0'
api 'com.google.api.grpc:proto-google-iam-v1:0.12.0'
api 'com.google.cloud:google-cloud-core-http:1.93.3'
api 'com.google.auth:google-auth-library-credentials:0.20.0'
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8adcbc3c5c3b1b7af1cf1e8a25af26a516d62a4c
4 changes: 2 additions & 2 deletions server/src/main/java/org/opensearch/Version.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ public class Version implements Comparable<Version>, ToXContentFragment {
public static final Version V_1_3_0 = new Version(1030099, org.apache.lucene.util.Version.LUCENE_8_10_1);
public static final Version V_1_3_1 = new Version(1030199, org.apache.lucene.util.Version.LUCENE_8_10_1);
public static final Version V_1_3_2 = new Version(1030299, org.apache.lucene.util.Version.LUCENE_8_10_1);
public static final Version V_1_4_0 = new Version(1040099, org.apache.lucene.util.Version.LUCENE_8_10_1);
public static final Version V_2_0_0 = new Version(2000099, org.apache.lucene.util.Version.LUCENE_9_1_0);
public static final Version CURRENT = V_2_0_0;
public static final Version V_2_1_0 = new Version(2010099, org.apache.lucene.util.Version.LUCENE_9_1_0);
public static final Version CURRENT = V_2_1_0;

public static Version readVersion(StreamInput in) throws IOException {
return fromId(in.readVInt());
Expand Down
27 changes: 11 additions & 16 deletions server/src/main/java/org/opensearch/index/get/ShardGetService.java
Original file line number Diff line number Diff line change
Expand Up @@ -216,25 +216,20 @@ private GetResult innerGet(
fetchSourceContext = normalizeFetchSourceContent(fetchSourceContext, gFields);

Term uidTerm = new Term(IdFieldMapper.NAME, Uid.encodeId(id));
Engine.GetResult get = indexShard.get(
new Engine.Get(realtime, true, id, uidTerm).version(version)
.versionType(versionType)
.setIfSeqNo(ifSeqNo)
.setIfPrimaryTerm(ifPrimaryTerm)
);
if (get.exists() == false) {
get.close();
}

if (get == null || get.exists() == false) {
return new GetResult(shardId.getIndexName(), id, UNASSIGNED_SEQ_NO, UNASSIGNED_PRIMARY_TERM, -1, false, null, null, null);
}

try {
try (
Engine.GetResult get = indexShard.get(
new Engine.Get(realtime, true, id, uidTerm).version(version)
.versionType(versionType)
.setIfSeqNo(ifSeqNo)
.setIfPrimaryTerm(ifPrimaryTerm)
)
) {
if (get == null || get.exists() == false) {
return new GetResult(shardId.getIndexName(), id, UNASSIGNED_SEQ_NO, UNASSIGNED_PRIMARY_TERM, -1, false, null, null, null);
}
// break between having loaded it from translog (so we only have _source), and having a document to load
return innerGetLoadFromStoredFields(id, gFields, fetchSourceContext, get, mapperService);
} finally {
get.close();
}
}

Expand Down
6 changes: 1 addition & 5 deletions server/src/main/java/org/opensearch/node/Node.java
Original file line number Diff line number Diff line change
Expand Up @@ -348,11 +348,7 @@ protected Node(
Settings tmpSettings = Settings.builder()
.put(initialEnvironment.settings())
.put(Client.CLIENT_TYPE_SETTING_S.getKey(), CLIENT_TYPE)
.build();

// Enabling shard indexing backpressure node-attribute
tmpSettings = Settings.builder()
.put(tmpSettings)
// Enabling shard indexing backpressure node-attribute
.put(NODE_ATTRIBUTES.getKey() + SHARD_INDEXING_PRESSURE_ENABLED_ATTRIBUTE_KEY, "true")
.build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ static Tuple<List<Version>, List<Version>> resolveReleasedVersions(Version curre
stableVersions = previousMajor;
// remove current
moveLastToUnreleased(currentMajor, unreleasedVersions);
} else if (current.major != 1 && current.major != 2) {
} else if (current.major != 1) {
// on a stable or release branch, ie N.x
stableVersions = currentMajor;
// remove the next maintenance bugfix
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,8 @@ protected String getProtocol() {
protected RestClient buildClient(Settings settings, HttpHost[] hosts) throws IOException {
RestClientBuilder builder = RestClient.builder(hosts);
configureClient(builder, settings);
builder.setStrictDeprecationMode(true);
// TODO: set the method argument to 'true' after PR https://github.com/opensearch-project/OpenSearch/pull/2683 merged.
builder.setStrictDeprecationMode(false);
return builder.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,15 +284,17 @@ public void testResolveReleasedVersionsAtNewMinorBranchIn2x() {
Arrays.asList(
TestNewMinorBranchIn6x.V_1_6_0,
TestNewMinorBranchIn6x.V_1_6_1,
TestNewMinorBranchIn6x.V_1_6_2,
TestNewMinorBranchIn6x.V_2_0_0,
TestNewMinorBranchIn6x.V_2_0_1,
TestNewMinorBranchIn6x.V_2_1_0,
TestNewMinorBranchIn6x.V_2_1_1
)
)
);
assertThat(unreleased, equalTo(Arrays.asList(TestNewMinorBranchIn6x.V_2_1_2, TestNewMinorBranchIn6x.V_2_2_0)));
assertThat(
unreleased,
equalTo(Arrays.asList(TestNewMinorBranchIn6x.V_1_6_2, TestNewMinorBranchIn6x.V_2_1_2, TestNewMinorBranchIn6x.V_2_2_0))
);
}

/**
Expand Down

0 comments on commit 58b30d4

Please sign in to comment.