From 6b0ab0869a676d72e0c2c9ba7690a003ff45a778 Mon Sep 17 00:00:00 2001 From: Sachin Kale Date: Wed, 13 Sep 2023 23:13:49 +0530 Subject: [PATCH] Fix for searchable snapshot Signed-off-by: Sachin Kale --- server/src/main/java/org/opensearch/index/shard/IndexShard.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/main/java/org/opensearch/index/shard/IndexShard.java b/server/src/main/java/org/opensearch/index/shard/IndexShard.java index e6e2554c7c012..3325f6ad9afe2 100644 --- a/server/src/main/java/org/opensearch/index/shard/IndexShard.java +++ b/server/src/main/java/org/opensearch/index/shard/IndexShard.java @@ -2370,7 +2370,7 @@ private void innerOpenEngineAndTranslog(LongSupplier globalCheckpointSupplier, b // so before that step, we are deleting the translog files present in remote store. deleteTranslogFilesFromRemoteTranslog(); } - } else { + } else if (syncFromRemote) { final SegmentInfos lastCommittedSegmentInfos = store().readLastCommittedSegmentsInfo(); final String translogUUID = lastCommittedSegmentInfos.userData.get(TRANSLOG_UUID_KEY); final long checkpoint = Long.parseLong(lastCommittedSegmentInfos.userData.get(SequenceNumbers.LOCAL_CHECKPOINT_KEY));