Skip to content

Commit

Permalink
Fix testKeepTranslogAfterGlobalCheckpoint
Browse files Browse the repository at this point in the history
Read the last synced global checkpoint after flushing as
we might advance it during committing.

CI: https://gradle-enterprise.elastic.co/s/7o6qengg4gva2
  • Loading branch information
dnhatn committed Feb 25, 2020
1 parent 6a371fe commit ad8db67
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4891,8 +4891,8 @@ protected void commitIndexWriter(IndexWriter writer, Translog translog, String s
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);
Expand Down

0 comments on commit ad8db67

Please sign in to comment.