Skip to content

Commit

Permalink
Recover all translogs during relocation handoff for remote-backed ind…
Browse files Browse the repository at this point in the history
…exes

Signed-off-by: Ashish Singh <[email protected]>
  • Loading branch information
ashking94 committed Feb 14, 2023
1 parent 0eee9a9 commit 7ae0c9c
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4311,9 +4311,13 @@ public void close() throws IOException {
// TODO: add a dedicate recovery stats for the reset translog
}
);

// When the new engine is created, translogs are synced from remote store onto local. Since remote store is the source
// of truth for translog, we play all translogs that exists locally. Otherwise, the recoverUpto happens upto global checkpoint.
long recoverUpto = this.isRemoteTranslogEnabled() ? Long.MAX_VALUE : globalCheckpoint;
newEngineReference.get()
.translogManager()
.recoverFromTranslog(translogRunner, newEngineReference.get().getProcessedLocalCheckpoint(), globalCheckpoint);
.recoverFromTranslog(translogRunner, newEngineReference.get().getProcessedLocalCheckpoint(), recoverUpto);
newEngineReference.get().refresh("reset_engine");
synchronized (engineMutex) {
verifyNotClosed();
Expand Down

0 comments on commit 7ae0c9c

Please sign in to comment.