Skip to content

Commit

Permalink
Allow to trim all ops above a certain seq# with a term lower than X, …
Browse files Browse the repository at this point in the history
…post backport fix (#31211)
  • Loading branch information
vladimirdolzhenko committed Jun 8, 2018
1 parent b26aae3 commit 12fa0f4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void readFrom(final StreamInput in) throws IOException {
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;
Expand All @@ -79,7 +79,7 @@ public void readFrom(final StreamInput in) throws IOException {
@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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 12fa0f4

Please sign in to comment.