From 1615c4b379000b117ea770a46b626afbefec966f Mon Sep 17 00:00:00 2001 From: Nhat Nguyen Date: Wed, 18 Mar 2020 11:24:19 -0400 Subject: [PATCH] Fix testKeepTranslogAfterGlobalCheckpoint (#53704) Read the global checkpoint after flushed as we might advance it while flushing. Closes #53505 --- .../org/elasticsearch/index/engine/InternalEngineTests.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/src/test/java/org/elasticsearch/index/engine/InternalEngineTests.java b/server/src/test/java/org/elasticsearch/index/engine/InternalEngineTests.java index 5d3de4aa434..b004cf87764 100644 --- a/server/src/test/java/org/elasticsearch/index/engine/InternalEngineTests.java +++ b/server/src/test/java/org/elasticsearch/index/engine/InternalEngineTests.java @@ -4828,7 +4828,6 @@ public class InternalEngineTests extends EngineTestCase { } } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/53505") public void testKeepTranslogAfterGlobalCheckpoint() throws Exception { IOUtils.close(engine, store); final IndexSettings indexSettings = new IndexSettings(defaultSettings.getIndexMetaData(), defaultSettings.getNodeSettings(), @@ -4870,8 +4869,8 @@ public class InternalEngineTests extends EngineTestCase { engine.syncTranslog(); } if (frequently()) { - final long lastSyncedGlobalCheckpoint = Translog.readGlobalCheckpoint(translogPath, translogUUID); engine.flush(randomBoolean(), true); + final long lastSyncedGlobalCheckpoint = Translog.readGlobalCheckpoint(translogPath, translogUUID); final List commits = DirectoryReader.listCommits(store.directory()); // Keep only one safe commit as the oldest commit. final IndexCommit safeCommit = commits.get(0);