[Rollup] Update wire version check after backport

Bumping down the version to 6.4 since the backport is complete.  Also
adds some missing version checks to the bwc tests to make sure it
only runs on the correct versions
This commit is contained in:
Zachary Tong 2018-08-03 14:09:01 -04:00
parent e3cc33756e
commit 992ec4be5d
3 changed files with 9 additions and 2 deletions

View File

@ -85,7 +85,7 @@ public class RollupJobStatus implements Task.Status, PersistentTaskState {
public RollupJobStatus(StreamInput in) throws IOException {
state = IndexerState.fromStream(in);
currentPosition = in.readBoolean() ? new TreeMap<>(in.readMap()) : null;
if (in.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) { //TODO change this after backport
if (in.getVersion().onOrAfter(Version.V_6_4_0)) {
upgradedDocumentID = in.readBoolean();
} else {
// If we're getting this job from a pre-6.4.0 node,
@ -138,7 +138,7 @@ public class RollupJobStatus implements Task.Status, PersistentTaskState {
if (currentPosition != null) {
out.writeMap(currentPosition);
}
if (out.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) { //TODO change this after backport
if (out.getVersion().onOrAfter(Version.V_6_4_0)) {
out.writeBoolean(upgradedDocumentID);
}
}

View File

@ -327,6 +327,7 @@ public class FullClusterRestartIT extends ESRestTestCase {
public void testRollupIDSchemeAfterRestart() throws Exception {
assumeTrue("Rollup can be tested with 6.3.0 and onwards", oldClusterVersion.onOrAfter(Version.V_6_3_0));
assumeTrue("Rollup ID scheme changed in 6.4", oldClusterVersion.before(Version.V_6_4_0));
if (runningAgainstOldCluster) {
final Request indexRequest = new Request("POST", "/id-test-rollup/_doc/1");

View File

@ -5,6 +5,7 @@
*/
package org.elasticsearch.upgrades;
import org.elasticsearch.Version;
import org.elasticsearch.client.Request;
import org.elasticsearch.client.Response;
import org.elasticsearch.common.Booleans;
@ -30,6 +31,9 @@ import static org.hamcrest.Matchers.equalTo;
public class RollupIDUpgradeIT extends AbstractUpgradeTestCase {
private static final Version UPGRADE_FROM_VERSION =
Version.fromString(System.getProperty("tests.upgrade_from_version"));
/**
* This test verifies that as a cluster is upgraded incrementally, new documents eventually switch
* over to the "new" form of ID (128 bit Murmur3 ids).
@ -46,6 +50,8 @@ public class RollupIDUpgradeIT extends AbstractUpgradeTestCase {
* The last phase is guaranteed to be new as it's a fully upgraded cluster.
*/
public void testIDsUpgradeCorrectly() throws Exception {
assumeTrue("Rollup became available in 6.3", UPGRADE_FROM_VERSION.onOrAfter(Version.V_6_3_0));
assumeTrue("Rollup ID change happened in 6.4", UPGRADE_FROM_VERSION.before(Version.V_6_4_0));
switch (CLUSTER_TYPE) {
case OLD:
break;