From c48fb5535859403e4a12090d686b21b62b3c76a9 Mon Sep 17 00:00:00 2001 From: Ashish Date: Tue, 16 Jan 2024 18:07:44 +0530 Subject: [PATCH] Add missing code in InternalEngine part of #10513 (#11883) Signed-off-by: Ashish Singh --- .../index/engine/InternalEngine.java | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/server/src/main/java/org/opensearch/index/engine/InternalEngine.java b/server/src/main/java/org/opensearch/index/engine/InternalEngine.java index 88b58403a8ac6..afdf40f5339c6 100644 --- a/server/src/main/java/org/opensearch/index/engine/InternalEngine.java +++ b/server/src/main/java/org/opensearch/index/engine/InternalEngine.java @@ -2032,22 +2032,8 @@ private void refreshLastCommittedSegmentInfos() { } @Override - public void rollTranslogGeneration() throws EngineException { - try (ReleasableLock ignored = readLock.acquire()) { - ensureOpen(); - translogManager().getTranslog().rollGeneration(); - translogManager().getTranslog().trimUnreferencedReaders(); - } catch (AlreadyClosedException e) { - failOnTragicEvent(e); - throw e; - } catch (Exception e) { - try { - failEngine("translog trimming failed", e); - } catch (Exception inner) { - e.addSuppressed(inner); - } - throw new EngineException(shardId, "failed to roll translog", e); - } + public void rollTranslogGeneration() throws EngineException, IOException { + translogManager().rollTranslogGeneration(); } @Override