From 875bbfe699f1ca42ee4ba87eabcfc7c865c588c9 Mon Sep 17 00:00:00 2001 From: Nhat Nguyen Date: Fri, 2 Feb 2018 11:48:07 -0500 Subject: [PATCH] Backported the harden synced-flush PR to v6.3.0 Relates #28464 --- .../org/elasticsearch/indices/flush/SyncedFlushService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/indices/flush/SyncedFlushService.java b/server/src/main/java/org/elasticsearch/indices/flush/SyncedFlushService.java index 77a5b7fc7e2..eff6d7ab3b9 100644 --- a/server/src/main/java/org/elasticsearch/indices/flush/SyncedFlushService.java +++ b/server/src/main/java/org/elasticsearch/indices/flush/SyncedFlushService.java @@ -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); } }