parent
965efa51cc
commit
de6d31ebc2
|
@ -365,7 +365,7 @@ public class ShardStateAction extends AbstractComponent {
|
||||||
primaryTerm = in.readVLong();
|
primaryTerm = in.readVLong();
|
||||||
message = in.readString();
|
message = in.readString();
|
||||||
failure = in.readException();
|
failure = in.readException();
|
||||||
if (in.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
|
if (in.getVersion().onOrAfter(Version.V_6_3_0)) {
|
||||||
markAsStale = in.readBoolean();
|
markAsStale = in.readBoolean();
|
||||||
} else {
|
} else {
|
||||||
markAsStale = true;
|
markAsStale = true;
|
||||||
|
@ -397,7 +397,7 @@ public class ShardStateAction extends AbstractComponent {
|
||||||
out.writeVLong(primaryTerm);
|
out.writeVLong(primaryTerm);
|
||||||
out.writeString(message);
|
out.writeString(message);
|
||||||
out.writeException(failure);
|
out.writeException(failure);
|
||||||
if (out.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
|
if (out.getVersion().onOrAfter(Version.V_6_3_0)) {
|
||||||
out.writeBoolean(markAsStale);
|
out.writeBoolean(markAsStale);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -523,12 +523,12 @@ public class ShardStateAction extends AbstractComponent {
|
||||||
super(in);
|
super(in);
|
||||||
shardId = ShardId.readShardId(in);
|
shardId = ShardId.readShardId(in);
|
||||||
allocationId = in.readString();
|
allocationId = in.readString();
|
||||||
if (in.getVersion().before(Version.V_7_0_0_alpha1)) {
|
if (in.getVersion().before(Version.V_6_3_0)) {
|
||||||
final long primaryTerm = in.readVLong();
|
final long primaryTerm = in.readVLong();
|
||||||
assert primaryTerm == 0L : "shard is only started by itself: primary term [" + primaryTerm + "]";
|
assert primaryTerm == 0L : "shard is only started by itself: primary term [" + primaryTerm + "]";
|
||||||
}
|
}
|
||||||
this.message = in.readString();
|
this.message = in.readString();
|
||||||
if (in.getVersion().before(Version.V_7_0_0_alpha1)) {
|
if (in.getVersion().before(Version.V_6_3_0)) {
|
||||||
final Exception ex = in.readException();
|
final Exception ex = in.readException();
|
||||||
assert ex == null : "started shard must not have failure [" + ex + "]";
|
assert ex == null : "started shard must not have failure [" + ex + "]";
|
||||||
}
|
}
|
||||||
|
@ -545,11 +545,11 @@ public class ShardStateAction extends AbstractComponent {
|
||||||
super.writeTo(out);
|
super.writeTo(out);
|
||||||
shardId.writeTo(out);
|
shardId.writeTo(out);
|
||||||
out.writeString(allocationId);
|
out.writeString(allocationId);
|
||||||
if (out.getVersion().before(Version.V_7_0_0_alpha1)) {
|
if (out.getVersion().before(Version.V_6_3_0)) {
|
||||||
out.writeVLong(0L);
|
out.writeVLong(0L);
|
||||||
}
|
}
|
||||||
out.writeString(message);
|
out.writeString(message);
|
||||||
if (out.getVersion().before(Version.V_7_0_0_alpha1)) {
|
if (out.getVersion().before(Version.V_6_3_0)) {
|
||||||
out.writeException(null);
|
out.writeException(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -423,7 +423,7 @@ public class ShardStateActionTests extends ESTestCase {
|
||||||
|
|
||||||
public void testShardEntryBWCSerialize() throws Exception {
|
public void testShardEntryBWCSerialize() throws Exception {
|
||||||
final Version bwcVersion = randomValueOtherThanMany(
|
final Version bwcVersion = randomValueOtherThanMany(
|
||||||
version -> version.onOrAfter(Version.V_7_0_0_alpha1), () -> VersionUtils.randomVersion(random()));
|
version -> version.onOrAfter(Version.V_6_3_0), () -> VersionUtils.randomVersion(random()));
|
||||||
final ShardId shardId = new ShardId(randomRealisticUnicodeOfLengthBetween(10, 100), UUID.randomUUID().toString(), between(0, 1000));
|
final ShardId shardId = new ShardId(randomRealisticUnicodeOfLengthBetween(10, 100), UUID.randomUUID().toString(), between(0, 1000));
|
||||||
final String allocationId = randomRealisticUnicodeOfCodepointLengthBetween(10, 100);
|
final String allocationId = randomRealisticUnicodeOfCodepointLengthBetween(10, 100);
|
||||||
final String reason = randomRealisticUnicodeOfCodepointLengthBetween(10, 100);
|
final String reason = randomRealisticUnicodeOfCodepointLengthBetween(10, 100);
|
||||||
|
|
Loading…
Reference in New Issue