This commit is contained in:
Simon Willnauer 2016-03-31 15:15:39 +02:00
parent f7cbc384f7
commit 4657796b24
1 changed files with 5 additions and 1 deletions

View File

@ -2070,7 +2070,11 @@ public class InternalEngineTests extends ESTestCase {
for (int i = 0; i < 2; i++) { for (int i = 0; i < 2; i++) {
try (InternalEngine engine = new InternalEngine(copy(config, EngineConfig.OpenMode.OPEN_INDEX_AND_TRANSLOG))) { try (InternalEngine engine = new InternalEngine(copy(config, EngineConfig.OpenMode.OPEN_INDEX_AND_TRANSLOG))) {
Map<String, String> userData = engine.getLastCommittedSegmentInfos().getUserData(); Map<String, String> userData = engine.getLastCommittedSegmentInfos().getUserData();
assertEquals("1", userData.get(Translog.TRANSLOG_GENERATION_KEY)); if (i == 0) {
assertEquals("1", userData.get(Translog.TRANSLOG_GENERATION_KEY));
} else {
assertEquals("3", userData.get(Translog.TRANSLOG_GENERATION_KEY));
}
assertEquals(engine.getTranslog().getTranslogUUID(), userData.get(Translog.TRANSLOG_UUID_KEY)); assertEquals(engine.getTranslog().getTranslogUUID(), userData.get(Translog.TRANSLOG_UUID_KEY));
engine.recoverFromTranslog(); engine.recoverFromTranslog();
userData = engine.getLastCommittedSegmentInfos().getUserData(); userData = engine.getLastCommittedSegmentInfos().getUserData();