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 f65ae74 commit 6a0b9b5
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 6a0b9b5

Please sign in to comment.