Only try to read new segments info if we really flushed the index (#20474)

There is no reason to read the current segments info unless we flushed
/ committed the lucene index.
This commit is contained in:
Simon Willnauer 2016-09-14 15:23:17 +02:00 committed by GitHub
parent 412c61c402
commit c1e84618a6
1 changed files with 22 additions and 22 deletions

View File

@ -789,7 +789,6 @@ public class InternalEngine extends Engine {
} catch (Exception e) {
throw new FlushFailedEngineException(shardId, e);
}
}
/*
* we have to inc-ref the store here since if the engine is closed by a tragic event
* we don't acquire the write lock and wait until we have exclusive access. This might also
@ -814,6 +813,7 @@ public class InternalEngine extends Engine {
} finally {
store.decRef();
}
}
newCommitId = lastCommittedSegmentInfos.getId();
} catch (FlushFailedEngineException ex) {
maybeFailEngine("flush", ex);