From 6fb588156cd482d9a5fd7bd646b0dc127d951aaf Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Thu, 31 Mar 2016 20:46:28 +0200 Subject: [PATCH] Remove redundant commit - #openTranslog() already commits in that case --- .../org/elasticsearch/index/engine/InternalEngine.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/index/engine/InternalEngine.java b/core/src/main/java/org/elasticsearch/index/engine/InternalEngine.java index b1f923222e9..c0c7b79e10d 100644 --- a/core/src/main/java/org/elasticsearch/index/engine/InternalEngine.java +++ b/core/src/main/java/org/elasticsearch/index/engine/InternalEngine.java @@ -156,15 +156,7 @@ public class InternalEngine extends Engine { manager = createSearcherManager(); this.searcherManager = manager; this.versionMap.setManager(searcherManager); - try { - if (openMode == EngineConfig.OpenMode.OPEN_INDEX_CREATE_TRANSLOG) { - // make sure we point at the latest translog from now on.. - commitIndexWriter(writer, translog, lastCommittedSegmentInfos.getUserData().get(SYNC_COMMIT_ID)); - } - } catch (IOException | EngineException ex) { - throw new EngineCreationFailureException(shardId, "failed to recover from translog", ex); - } - // don't allow commits unitl we are done with recovering + // don't allow commits until we are done with recovering allowCommits.compareAndSet(true, openMode != EngineConfig.OpenMode.OPEN_INDEX_AND_TRANSLOG); success = true; } finally {