Skip to content

Commit

Permalink
Add missing code in InternalEngine part of opensearch-project#10513
Browse files Browse the repository at this point in the history
Signed-off-by: Ashish Singh <[email protected]>
  • Loading branch information
ashking94 committed Jan 15, 2024
1 parent e93425d commit e4b070f
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
import org.opensearch.index.translog.TranslogStats;
import org.opensearch.index.translog.listener.CompositeTranslogEventListener;
import org.opensearch.index.translog.listener.TranslogEventListener;
import org.opensearch.index.translog.transfer.TranslogUploadFailedException;
import org.opensearch.search.suggest.completion.CompletionStats;
import org.opensearch.threadpool.ThreadPool;

Expand Down Expand Up @@ -2032,11 +2033,14 @@ private void refreshLastCommittedSegmentInfos() {
}

@Override
public void rollTranslogGeneration() throws EngineException {
public void rollTranslogGeneration() throws EngineException, TranslogUploadFailedException {
try (ReleasableLock ignored = readLock.acquire()) {
ensureOpen();
translogManager().getTranslog().rollGeneration();
translogManager().getTranslog().trimUnreferencedReaders();
} catch (TranslogUploadFailedException e) {
// Do not trigger the translogEventListener as it fails the Engine while this is only an issue with remote upload
throw e;
} catch (AlreadyClosedException e) {
failOnTragicEvent(e);
throw e;
Expand Down

0 comments on commit e4b070f

Please sign in to comment.