Skip to content

Commit

Permalink
Bump ES version to 5.6.1 (#26586)
Browse files Browse the repository at this point in the history
Minor modifications from the _UNRELEASED changes.
  • Loading branch information
hub-cap authored Sep 12, 2017
1 parent 854ef6b commit d39ac99
Show file tree
Hide file tree
Showing 22 changed files with 47 additions and 38 deletions.
2 changes: 1 addition & 1 deletion buildSrc/version.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
elasticsearch = 5.6.0
elasticsearch = 5.6.1
lucene = 6.6.1

# optional dependencies
Expand Down
22 changes: 13 additions & 9 deletions core/src/main/java/org/elasticsearch/Version.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,13 @@ public class Version implements Comparable<Version> {
public static final Version V_5_5_1 = new Version(V_5_5_1_ID, org.apache.lucene.util.Version.LUCENE_6_6_0);
public static final int V_5_5_2_ID = 5050299;
public static final Version V_5_5_2 = new Version(V_5_5_2_ID, org.apache.lucene.util.Version.LUCENE_6_6_0);
public static final int V_5_5_3_ID_UNRELEASED = 5050399;
public static final Version V_5_5_3_UNRELEASED = new Version(V_5_5_3_ID_UNRELEASED, org.apache.lucene.util.Version.LUCENE_6_6_0);
public static final int V_5_6_0_ID_UNRELEASED = 5060099;
public static final Version V_5_6_0_UNRELEASED = new Version(V_5_6_0_ID_UNRELEASED, org.apache.lucene.util.Version.LUCENE_6_6_1);
public static final Version CURRENT = V_5_6_0_UNRELEASED;
public static final int V_5_5_3_ID = 5050399;
public static final Version V_5_5_3 = new Version(V_5_5_3_ID, org.apache.lucene.util.Version.LUCENE_6_6_0);
public static final int V_5_6_0_ID = 5060099;
public static final Version V_5_6_0 = new Version(V_5_6_0_ID, org.apache.lucene.util.Version.LUCENE_6_6_0);
public static final int V_5_6_1_ID_UNRELEASED = 5060199;
public static final Version V_5_6_1_UNRELEASED = new Version(V_5_6_1_ID_UNRELEASED, org.apache.lucene.util.Version.LUCENE_6_6_1);
public static final Version CURRENT = V_5_6_1_UNRELEASED;

// unreleased versions must be added to the above list with the suffix _UNRELEASED (with the exception of CURRENT)

Expand All @@ -157,10 +159,12 @@ public static Version readVersion(StreamInput in) throws IOException {

public static Version fromId(int id) {
switch (id) {
case V_5_6_0_ID_UNRELEASED:
return V_5_6_0_UNRELEASED;
case V_5_5_3_ID_UNRELEASED:
return V_5_5_3_UNRELEASED;
case V_5_6_1_ID_UNRELEASED:
return V_5_6_1_UNRELEASED;
case V_5_6_0_ID:
return V_5_6_0;
case V_5_5_3_ID:
return V_5_5_3;
case V_5_5_2_ID:
return V_5_5_2;
case V_5_5_1_ID:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
readAcknowledged(in);
shardsAcked = in.readBoolean();
if (in.getVersion().onOrAfter(Version.V_5_6_0_UNRELEASED)) {
if (in.getVersion().onOrAfter(Version.V_5_6_0)) {
index = in.readString();
}
}
Expand All @@ -60,7 +60,7 @@ public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
writeAcknowledged(out);
out.writeBoolean(shardsAcked);
if (out.getVersion().onOrAfter(Version.V_5_6_0_UNRELEASED)) {
if (out.getVersion().onOrAfter(Version.V_5_6_0)) {
out.writeString(index);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public void readFrom(StreamInput in) throws IOException {
request.version(primaryResponse.getVersion());
request.versionType(request.versionType().versionTypeForReplicationAndRecovery());
}
if (in.getVersion().before(Version.V_5_6_0_UNRELEASED)) {
if (in.getVersion().before(Version.V_5_6_0)) {
boolean ignoreOnReplica = in.readBoolean();
assert ignoreOnReplica == isIgnoreOnReplica() :
"ignoreOnReplica mismatch. wire [" + ignoreOnReplica + "], ours [" + isIgnoreOnReplica() + "]";
Expand All @@ -132,7 +132,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeVInt(id);
DocWriteRequest.writeDocumentRequest(out, request);
out.writeOptionalStreamable(primaryResponse);
if (out.getVersion().before(Version.V_5_6_0_UNRELEASED)) {
if (out.getVersion().before(Version.V_5_6_0)) {
out.writeBoolean(isIgnoreOnReplica());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ public void writeTo(StreamOutput out) throws IOException {
private static Version V_6_0_0_BETA_2 = Version.fromString("6.0.0-beta2");
private static boolean supportsAbortedFlag(Version version) {
// The "aborted" flag was added for 5.5.3 and 5.6.0, but was not in 6.0.0-beta2
return version.after(V_6_0_0_BETA_2) || (version.major == 5 && version.onOrAfter(Version.V_5_5_3_UNRELEASED));
return version.after(V_6_0_0_BETA_2) || (version.major == 5 && version.onOrAfter(Version.V_5_5_3));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ public void readFrom(StreamInput in) throws IOException {
requestCache = in.readOptionalBoolean();
if (in.getVersion().onOrAfter(Version.V_5_4_0)) {
batchedReduceSize = in.readVInt();
if (in.getVersion().onOrAfter(Version.V_5_6_0_UNRELEASED)) {
if (in.getVersion().onOrAfter(Version.V_5_6_0)) {
maxConcurrentShardRequests = in.readVInt();
preFilterShardSize = in.readVInt();
}
Expand All @@ -425,7 +425,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeOptionalBoolean(requestCache);
if (out.getVersion().onOrAfter(Version.V_5_4_0)) {
out.writeVInt(batchedReduceSize);
if (out.getVersion().onOrAfter(Version.V_5_6_0_UNRELEASED)) {
if (out.getVersion().onOrAfter(Version.V_5_6_0)) {
out.writeVInt(maxConcurrentShardRequests);
out.writeVInt(preFilterShardSize);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ public void readFrom(StreamInput in) throws IOException {
}
scrollId = in.readOptionalString();
tookInMillis = in.readVLong();
if (in.getVersion().onOrAfter(Version.V_5_6_0_UNRELEASED)) {
if (in.getVersion().onOrAfter(Version.V_5_6_0)) {
skippedShards = in.readVInt();
}
}
Expand All @@ -350,7 +350,7 @@ public void writeTo(StreamOutput out) throws IOException {

out.writeOptionalString(scrollId);
out.writeVLong(tookInMillis);
if(out.getVersion().onOrAfter(Version.V_5_6_0_UNRELEASED)) {
if(out.getVersion().onOrAfter(Version.V_5_6_0)) {
out.writeVInt(skippedShards);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public void sendFreeContext(Transport.Connection connection, long contextId, fin

public void sendCanMatch(Transport.Connection connection, final ShardSearchTransportRequest request, SearchTask task, final
ActionListener<CanMatchResponse> listener) {
if (connection.getNode().getVersion().onOrAfter(Version.V_5_6_0_UNRELEASED)) {
if (connection.getNode().getVersion().onOrAfter(Version.V_5_6_0)) {
transportService.sendChildRequest(connection, QUERY_CAN_MATCH_NAME, request, task,
TransportRequestOptions.EMPTY, new ActionListenerResponseHandler<>(listener, CanMatchResponse::new));
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public final TimeValue timeout() {
protected void readTimeout(StreamInput in) throws IOException {
// in older ES versions, we would explicitly call this method in subclasses
// now we properly serialize the timeout value as part of the readFrom method
if (in.getVersion().before(Version.V_5_6_0_UNRELEASED)) {
if (in.getVersion().before(Version.V_5_6_0)) {
timeout = new TimeValue(in);
}
}
Expand All @@ -90,7 +90,7 @@ protected void readTimeout(StreamInput in) throws IOException {
protected void writeTimeout(StreamOutput out) throws IOException {
// in older ES versions, we would explicitly call this method in subclasses
// now we properly serialize the timeout value as part of the writeTo method
if (out.getVersion().before(Version.V_5_6_0_UNRELEASED)) {
if (out.getVersion().before(Version.V_5_6_0)) {
timeout.writeTo(out);
}
}
Expand All @@ -103,15 +103,15 @@ public TimeValue ackTimeout() {
@Override
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
if (in.getVersion().onOrAfter(Version.V_5_6_0_UNRELEASED)) {
if (in.getVersion().onOrAfter(Version.V_5_6_0)) {
timeout = new TimeValue(in);
}
}

@Override
public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
if (out.getVersion().onOrAfter(Version.V_5_6_0_UNRELEASED)) {
if (out.getVersion().onOrAfter(Version.V_5_6_0)) {
timeout.writeTo(out);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ public void readFrom(StreamInput in) throws IOException {
timeout = new TimeValue(in);
index = in.readString();
routedBasedOnClusterVersion = in.readVLong();
if (in.getVersion().before(Version.V_5_6_0_UNRELEASED)) {
if (in.getVersion().before(Version.V_5_6_0)) {
primaryTerm = in.readVLong();
} else {
primaryTerm = 0L;
Expand All @@ -234,7 +234,7 @@ public void writeTo(StreamOutput out) throws IOException {
timeout.writeTo(out);
out.writeString(index);
out.writeVLong(routedBasedOnClusterVersion);
if (out.getVersion().before(Version.V_5_6_0_UNRELEASED)) {
if (out.getVersion().before(Version.V_5_6_0)) {
out.writeVLong(primaryTerm);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1094,19 +1094,19 @@ public String getDescription() {
@Override
public void readFrom(StreamInput in) throws IOException {
targetAllocationID = in.readString();
if (in.getVersion().onOrAfter(Version.V_5_6_0_UNRELEASED)) {
if (in.getVersion().onOrAfter(Version.V_5_6_0)) {
primaryTerm = in.readVLong();
}
request.readFrom(in);
if (in.getVersion().before(Version.V_5_6_0_UNRELEASED)) {
if (in.getVersion().before(Version.V_5_6_0)) {
primaryTerm = request.primaryTerm(); // for bwc with ES < v5.6, that has the primary term on the inner ReplicationRequest
}
}

@Override
public void writeTo(StreamOutput out) throws IOException {
out.writeString(targetAllocationID);
if (out.getVersion().onOrAfter(Version.V_5_6_0_UNRELEASED)) {
if (out.getVersion().onOrAfter(Version.V_5_6_0)) {
out.writeVLong(primaryTerm);
} else {
// ensure that inner ReplicationRequest has primary term set
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public SearchShardTarget(StreamInput in) throws IOException {
}
shardId = ShardId.readShardId(in);
this.originalIndices = null;
if (in.getVersion().onOrAfter(Version.V_5_6_0_UNRELEASED)) {
if (in.getVersion().onOrAfter(Version.V_5_6_0)) {
clusterAlias = in.readOptionalString();
} else {
clusterAlias = null;
Expand Down Expand Up @@ -114,7 +114,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeText(nodeId);
}
shardId.writeTo(out);
if (out.getVersion().onOrAfter(Version.V_5_6_0_UNRELEASED)) {
if (out.getVersion().onOrAfter(Version.V_5_6_0)) {
out.writeOptionalString(clusterAlias);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ protected void innerReadFrom(StreamInput in) throws IOException {
}
nowInMillis = in.readVLong();
requestCache = in.readOptionalBoolean();
if (in.getVersion().onOrAfter(Version.V_5_6_0_UNRELEASED)) {
if (in.getVersion().onOrAfter(Version.V_5_6_0)) {
clusterAlias = in.readOptionalString();
}
}
Expand All @@ -221,7 +221,7 @@ protected void innerWriteTo(StreamOutput out, boolean asKey) throws IOException
out.writeVLong(nowInMillis);
}
out.writeOptionalBoolean(requestCache);
if (out.getVersion().onOrAfter(Version.V_5_6_0_UNRELEASED)) {
if (out.getVersion().onOrAfter(Version.V_5_6_0)) {
out.writeOptionalString(clusterAlias);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public void testOldNodesTriggerException() {
SearchTransportService searchTransportService = new SearchTransportService(
Settings.builder().put("search.remote.connect", false).build(), null);
DiscoveryNode node = new DiscoveryNode("node_1", LocalTransportAddress.buildUnique(),
VersionUtils.getPreviousVersion(Version.V_5_6_0_UNRELEASED));
VersionUtils.getPreviousVersion(Version.V_5_6_0));
SearchAsyncActionTests.MockConnection mockConnection = new SearchAsyncActionTests.MockConnection(node);
IllegalArgumentException illegalArgumentException = expectThrows(IllegalArgumentException.class,
() -> searchTransportService.sendCanMatch(mockConnection, null, null, null));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ protected DiscoveryNode createNode(DiscoveryNode.Role... mustHaveRoles) {
}
final String id = String.format(Locale.ROOT, "node_%03d", nodeIdGenerator.incrementAndGet());
return new DiscoveryNode(id, id, buildNewFakeTransportAddress(), Collections.emptyMap(), roles,
VersionUtils.randomVersionBetween(random(), Version.V_5_6_0_UNRELEASED, null));
VersionUtils.randomVersionBetween(random(), Version.V_5_6_0, null));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -606,8 +606,8 @@ public void testReplicaOnNewestVersionIsPromoted() {

clusterState = ClusterState.builder(clusterState).nodes(
DiscoveryNodes.builder(clusterState.nodes())
.add(newNode("node3-6.x", VersionUtils.randomVersionBetween(random(), Version.V_5_6_0_UNRELEASED, null)))
.add(newNode("node4-6.x", VersionUtils.randomVersionBetween(random(), Version.V_5_6_0_UNRELEASED, null))))
.add(newNode("node3-6.x", VersionUtils.randomVersionBetween(random(), Version.V_5_6_0, null)))
.add(newNode("node4-6.x", VersionUtils.randomVersionBetween(random(), Version.V_5_6_0, null))))
.build();

// start all the replicas
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ protected ICUCollationKeywordFieldMapper(String simpleName, MappedFieldType fiel
this.variableTop = variableTop;
this.hiraganaQuaternaryMode = hiraganaQuaternaryMode;
this.collator = collator;
if (indexCreatedVersion.onOrAfter(Version.V_5_6_0_UNRELEASED)) {
if (indexCreatedVersion.onOrAfter(Version.V_5_6_0)) {
getDVField = SortedSetDocValuesField::new;
} else {
getDVField = SortedDocValuesField::new;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
"Index data, search, and create things in the cluster state that we'll validate are there after the ugprade":
- skip:
features: "warnings"

- do:
indices.create:
index: test_index
Expand Down Expand Up @@ -83,6 +86,8 @@
- match: { "acknowledged": true }

- do:
warnings:
- "The stored search template API is deprecated. Use stored scripts instead."
put_template:
id: test_search_template
body:
Expand Down

0 comments on commit d39ac99

Please sign in to comment.