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 (#6314)

Signed-off-by: Ashish Singh <ssashish@amazon.com>
  • Loading branch information
ashking94 authored Feb 14, 2023
1 parent 49d9a90 commit ac32259
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 ac32259

Please sign in to comment.