Backported the harden synced-flush PR to v6.3.0

Relates #28464
This commit is contained in:
Nhat Nguyen 2018-02-02 11:48:07 -05:00
parent 459233d550
commit 875bbfe699
1 changed files with 2 additions and 2 deletions

View File

@ -533,7 +533,7 @@ public class SyncedFlushService extends AbstractComponent implements IndexEventL
public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
commitId = new Engine.CommitId(in);
if (in.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
if (in.getVersion().onOrAfter(Version.V_6_3_0)) {
numDocs = in.readInt();
} else {
numDocs = UNKNOWN_NUM_DOCS;
@ -544,7 +544,7 @@ public class SyncedFlushService extends AbstractComponent implements IndexEventL
public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
commitId.writeTo(out);
if (out.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
if (out.getVersion().onOrAfter(Version.V_6_3_0)) {
out.writeInt(numDocs);
}
}