Fix testKeepTranslogAfterGlobalCheckpoint (#53704)
Read the global checkpoint after flushed as we might advance it while flushing. Closes #53505
This commit is contained in:
parent
75c367de13
commit
1615c4b379
|
@ -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<IndexCommit> commits = DirectoryReader.listCommits(store.directory());
|
||||
// Keep only one safe commit as the oldest commit.
|
||||
final IndexCommit safeCommit = commits.get(0);
|
||||
|
|
Loading…
Reference in New Issue