Skip to content

Commit

Permalink
Fix StoreRecovery
Browse files Browse the repository at this point in the history
Signed-off-by: Sachin Kale <[email protected]>
  • Loading branch information
Sachin Kale committed Sep 5, 2024
1 parent fcec555 commit 00b0f2c
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
import org.opensearch.core.index.shard.ShardId;
import org.opensearch.index.engine.Engine;
import org.opensearch.index.engine.EngineException;
import org.opensearch.index.engine.InternalEngine;
import org.opensearch.index.mapper.MapperService;
import org.opensearch.index.remote.RemoteStorePathStrategy;
import org.opensearch.index.remote.RemoteStoreUtils;
Expand Down Expand Up @@ -525,8 +526,8 @@ void recoverShallowSnapshotV2(
indexShard.postRecovery("post recovery from remote_store");
SegmentInfos committedSegmentInfos = indexShard.store().readLastCommittedSegmentsInfo();
try {
indexShard.getEngine()
.translogManager()
assert indexShard.getEngine() instanceof InternalEngine;
((InternalEngine) indexShard.getEngine()).translogManager()
.setMinSeqNoToKeep(Long.parseLong(committedSegmentInfos.getUserData().get(SequenceNumbers.MAX_SEQ_NO)) + 1);
} catch (IllegalArgumentException e) {
logger.warn("MinSeqNoToKeep is already past the maxSeqNo from commited segment infos");
Expand Down

0 comments on commit 00b0f2c

Please sign in to comment.