Skip to content

Commit

Permalink
Fix SharedClusterSnapshotRestoreIT and RestoreSnapshotIT
Browse files Browse the repository at this point in the history
Signed-off-by: Sachin Kale <kalsac@amazon.com>
  • Loading branch information
Sachin Kale committed Sep 6, 2023
1 parent fdd357c commit 62feea0
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -24,6 +24,7 @@
import org.opensearch.index.seqno.SeqNoStats;
import org.opensearch.index.seqno.SequenceNumbers;
import org.opensearch.index.translog.Translog;
import org.opensearch.index.translog.TranslogCorruptedException;
import org.opensearch.index.translog.TranslogDeletionPolicy;
import org.opensearch.index.translog.TranslogException;
import org.opensearch.index.translog.TranslogManager;
Expand Down Expand Up @@ -127,8 +128,9 @@ public void onAfterTranslogSync() {
engineConfig.getPrimaryModeSupplier()
);
this.translogManager = translogManagerRef;
} catch (IOException e) {
IOUtils.closeWhileHandlingException(store::decRef, readerManager, translogManagerRef);
} catch (IOException | TranslogCorruptedException e) {
store.decRef();
IOUtils.closeWhileHandlingException(readerManager, translogManagerRef);
throw new EngineCreationFailureException(shardId, "failed to create engine", e);
}
}
Expand Down

0 comments on commit 62feea0

Please sign in to comment.