Allow to trim all ops above a certain seq# with a term lower than X, post backport fix (#31211)

This commit is contained in:
Vladimir Dolzhenko 2018-06-08 12:11:20 -07:00 committed by GitHub
parent b26aae3915
commit 12fa0f437a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -68,7 +68,7 @@ public final class ResyncReplicationRequest extends ReplicatedWriteRequest<Resyn
throw new IllegalStateException("resync replication request serialization is broken in 6.0.0");
}
super.readFrom(in);
if (in.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
if (in.getVersion().onOrAfter(Version.V_6_4_0)) {
trimAboveSeqNo = in.readZLong();
} else {
trimAboveSeqNo = SequenceNumbers.UNASSIGNED_SEQ_NO;
@ -79,7 +79,7 @@ public final class ResyncReplicationRequest extends ReplicatedWriteRequest<Resyn
@Override
public void writeTo(final StreamOutput out) throws IOException {
super.writeTo(out);
if (out.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
if (out.getVersion().onOrAfter(Version.V_6_4_0)) {
out.writeZLong(trimAboveSeqNo);
}
out.writeArray(Translog.Operation::writeOperation, operations);

View File

@ -53,7 +53,7 @@ final class Checkpoint {
private static final String CHECKPOINT_CODEC = "ckp";
// size of 7.0.0 checkpoint
// size of 6.4.0 checkpoint
static final int V3_FILE_SIZE = CodecUtil.headerLength(CHECKPOINT_CODEC)
+ Integer.BYTES // ops