Remove redundant commit - #openTranslog() already commits in that case
This commit is contained in:
parent
ea055d2ac9
commit
6fb588156c
|
@ -156,15 +156,7 @@ public class InternalEngine extends Engine {
|
||||||
manager = createSearcherManager();
|
manager = createSearcherManager();
|
||||||
this.searcherManager = manager;
|
this.searcherManager = manager;
|
||||||
this.versionMap.setManager(searcherManager);
|
this.versionMap.setManager(searcherManager);
|
||||||
try {
|
// don't allow commits until we are done with recovering
|
||||||
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
|
|
||||||
allowCommits.compareAndSet(true, openMode != EngineConfig.OpenMode.OPEN_INDEX_AND_TRANSLOG);
|
allowCommits.compareAndSet(true, openMode != EngineConfig.OpenMode.OPEN_INDEX_AND_TRANSLOG);
|
||||||
success = true;
|
success = true;
|
||||||
} finally {
|
} finally {
|
||||||
|
|
Loading…
Reference in New Issue