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