Search in sources :

Example 1 with IndexShardRestoreFailedException

use of org.opensearch.index.snapshots.IndexShardRestoreFailedException in project OpenSearch by opensearch-project.

the class FileRestoreContext method restore.

/**
 * Performs restore operation
 */
public void restore(SnapshotFiles snapshotFiles, Store store, ActionListener<Void> listener) {
    store.incRef();
    try {
        logger.debug("[{}] [{}] restoring to [{}] ...", snapshotId, repositoryName, shardId);
        Store.MetadataSnapshot recoveryTargetMetadata;
        try {
            // this will throw an IOException if the store has no segments infos file. The
            // store can still have existing files but they will be deleted just before being
            // restored.
            recoveryTargetMetadata = store.getMetadata(null, true);
        } catch (org.apache.lucene.index.IndexNotFoundException e) {
            // happens when restore to an empty shard, not a big deal
            logger.trace("[{}] [{}] restoring from to an empty shard", shardId, snapshotId);
            recoveryTargetMetadata = Store.MetadataSnapshot.EMPTY;
        } catch (IOException e) {
            logger.warn(new ParameterizedMessage("[{}] [{}] Can't read metadata from store, will not reuse local files during restore", shardId, snapshotId), e);
            recoveryTargetMetadata = Store.MetadataSnapshot.EMPTY;
        }
        final List<BlobStoreIndexShardSnapshot.FileInfo> filesToRecover = new ArrayList<>();
        final Map<String, StoreFileMetadata> snapshotMetadata = new HashMap<>();
        final Map<String, BlobStoreIndexShardSnapshot.FileInfo> fileInfos = new HashMap<>();
        for (final BlobStoreIndexShardSnapshot.FileInfo fileInfo : snapshotFiles.indexFiles()) {
            snapshotMetadata.put(fileInfo.metadata().name(), fileInfo.metadata());
            fileInfos.put(fileInfo.metadata().name(), fileInfo);
        }
        final Store.MetadataSnapshot sourceMetadata = new Store.MetadataSnapshot(unmodifiableMap(snapshotMetadata), emptyMap(), 0);
        final StoreFileMetadata restoredSegmentsFile = sourceMetadata.getSegmentsFile();
        if (restoredSegmentsFile == null) {
            throw new IndexShardRestoreFailedException(shardId, "Snapshot has no segments file");
        }
        final Store.RecoveryDiff diff = sourceMetadata.recoveryDiff(recoveryTargetMetadata);
        for (StoreFileMetadata md : diff.identical) {
            BlobStoreIndexShardSnapshot.FileInfo fileInfo = fileInfos.get(md.name());
            recoveryState.getIndex().addFileDetail(fileInfo.physicalName(), fileInfo.length(), true);
            if (logger.isTraceEnabled()) {
                logger.trace("[{}] [{}] not_recovering file [{}] from [{}], exists in local store and is same", shardId, snapshotId, fileInfo.physicalName(), fileInfo.name());
            }
        }
        for (StoreFileMetadata md : concat(diff)) {
            BlobStoreIndexShardSnapshot.FileInfo fileInfo = fileInfos.get(md.name());
            filesToRecover.add(fileInfo);
            recoveryState.getIndex().addFileDetail(fileInfo.physicalName(), fileInfo.length(), false);
            if (logger.isTraceEnabled()) {
                logger.trace("[{}] [{}] recovering [{}] from [{}]", shardId, snapshotId, fileInfo.physicalName(), fileInfo.name());
            }
        }
        recoveryState.getIndex().setFileDetailsComplete();
        if (filesToRecover.isEmpty()) {
            logger.trace("[{}] [{}] no files to recover, all exist within the local store", shardId, snapshotId);
        }
        try {
            // list of all existing store files
            final List<String> deleteIfExistFiles = Arrays.asList(store.directory().listAll());
            for (final BlobStoreIndexShardSnapshot.FileInfo fileToRecover : filesToRecover) {
                // if a file with a same physical name already exist in the store we need to delete it
                // before restoring it from the snapshot. We could be lenient and try to reuse the existing
                // store files (and compare their names/length/checksum again with the snapshot files) but to
                // avoid extra complexity we simply delete them and restore them again like StoreRecovery
                // does with dangling indices. Any existing store file that is not restored from the snapshot
                // will be clean up by RecoveryTarget.cleanFiles().
                final String physicalName = fileToRecover.physicalName();
                if (deleteIfExistFiles.contains(physicalName)) {
                    logger.trace("[{}] [{}] deleting pre-existing file [{}]", shardId, snapshotId, physicalName);
                    store.directory().deleteFile(physicalName);
                }
            }
            restoreFiles(filesToRecover, store, ActionListener.wrap(v -> {
                store.incRef();
                try {
                    afterRestore(snapshotFiles, store, restoredSegmentsFile);
                    listener.onResponse(null);
                } finally {
                    store.decRef();
                }
            }, listener::onFailure));
        } catch (IOException ex) {
            throw new IndexShardRestoreFailedException(shardId, "Failed to recover index", ex);
        }
    } catch (Exception e) {
        listener.onFailure(e);
    } finally {
        store.decRef();
    }
}
Also used : IndexShardRestoreFailedException(org.opensearch.index.snapshots.IndexShardRestoreFailedException) Collections.emptyMap(java.util.Collections.emptyMap) Arrays(java.util.Arrays) SnapshotId(org.opensearch.snapshots.SnapshotId) Iterables(org.opensearch.common.util.iterable.Iterables) BlobStoreIndexShardSnapshot(org.opensearch.index.snapshots.blobstore.BlobStoreIndexShardSnapshot) IOException(java.io.IOException) HashMap(java.util.HashMap) ParameterizedMessage(org.apache.logging.log4j.message.ParameterizedMessage) SnapshotFiles(org.opensearch.index.snapshots.blobstore.SnapshotFiles) Store(org.opensearch.index.store.Store) ArrayList(java.util.ArrayList) ShardId(org.opensearch.index.shard.ShardId) List(java.util.List) Logger(org.apache.logging.log4j.Logger) RecoveryState(org.opensearch.indices.recovery.RecoveryState) Map(java.util.Map) Lucene(org.opensearch.common.lucene.Lucene) Collections.unmodifiableMap(java.util.Collections.unmodifiableMap) ActionListener(org.opensearch.action.ActionListener) LogManager(org.apache.logging.log4j.LogManager) StoreFileMetadata(org.opensearch.index.store.StoreFileMetadata) BlobStoreIndexShardSnapshot(org.opensearch.index.snapshots.blobstore.BlobStoreIndexShardSnapshot) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) Store(org.opensearch.index.store.Store) IndexShardRestoreFailedException(org.opensearch.index.snapshots.IndexShardRestoreFailedException) IOException(java.io.IOException) StoreFileMetadata(org.opensearch.index.store.StoreFileMetadata) IndexShardRestoreFailedException(org.opensearch.index.snapshots.IndexShardRestoreFailedException) IOException(java.io.IOException) ParameterizedMessage(org.apache.logging.log4j.message.ParameterizedMessage)

Example 2 with IndexShardRestoreFailedException

use of org.opensearch.index.snapshots.IndexShardRestoreFailedException in project OpenSearch by opensearch-project.

the class StoreRecovery method restore.

/**
 * Restores shard from {@link SnapshotRecoverySource} associated with this shard in routing table
 */
private void restore(IndexShard indexShard, Repository repository, SnapshotRecoverySource restoreSource, ActionListener<Boolean> listener) {
    logger.debug("restoring from {} ...", indexShard.recoveryState().getRecoverySource());
    indexShard.preRecovery();
    final RecoveryState.Translog translogState = indexShard.recoveryState().getTranslog();
    if (restoreSource == null) {
        listener.onFailure(new IndexShardRestoreFailedException(shardId, "empty restore source"));
        return;
    }
    if (logger.isTraceEnabled()) {
        logger.trace("[{}] restoring shard [{}]", restoreSource.snapshot(), shardId);
    }
    final ActionListener<Void> restoreListener = ActionListener.wrap(v -> {
        final Store store = indexShard.store();
        bootstrap(indexShard, store);
        assert indexShard.shardRouting.primary() : "only primary shards can recover from store";
        writeEmptyRetentionLeasesFile(indexShard);
        indexShard.openEngineAndRecoverFromTranslog();
        indexShard.getEngine().fillSeqNoGaps(indexShard.getPendingPrimaryTerm());
        indexShard.finalizeRecovery();
        indexShard.postRecovery("restore done");
        listener.onResponse(true);
    }, e -> listener.onFailure(new IndexShardRestoreFailedException(shardId, "restore failed", e)));
    try {
        translogState.totalOperations(0);
        translogState.totalOperationsOnStart(0);
        indexShard.prepareForIndexRecovery();
        final ShardId snapshotShardId;
        final IndexId indexId = restoreSource.index();
        if (shardId.getIndexName().equals(indexId.getName())) {
            snapshotShardId = shardId;
        } else {
            snapshotShardId = new ShardId(indexId.getName(), IndexMetadata.INDEX_UUID_NA_VALUE, shardId.id());
        }
        final StepListener<IndexId> indexIdListener = new StepListener<>();
        // If the index UUID was not found in the recovery source we will have to load RepositoryData and resolve it by index name
        if (indexId.getId().equals(IndexMetadata.INDEX_UUID_NA_VALUE)) {
            // BwC path, running against an old version master that did not add the IndexId to the recovery source
            repository.getRepositoryData(ActionListener.map(indexIdListener, repositoryData -> repositoryData.resolveIndexId(indexId.getName())));
        } else {
            indexIdListener.onResponse(indexId);
        }
        assert indexShard.getEngineOrNull() == null;
        indexIdListener.whenComplete(idx -> repository.restoreShard(indexShard.store(), restoreSource.snapshot().getSnapshotId(), idx, snapshotShardId, indexShard.recoveryState(), restoreListener), restoreListener::onFailure);
    } catch (Exception e) {
        restoreListener.onFailure(e);
    }
}
Also used : MappingMetadata(org.opensearch.cluster.metadata.MappingMetadata) TimeValue.timeValueMillis(org.opensearch.common.unit.TimeValue.timeValueMillis) NoMergePolicy(org.apache.lucene.index.NoMergePolicy) EngineException(org.opensearch.index.engine.EngineException) SequenceNumbers(org.opensearch.index.seqno.SequenceNumbers) Arrays(java.util.Arrays) IndexMetadata(org.opensearch.cluster.metadata.IndexMetadata) SnapshotRecoverySource(org.opensearch.cluster.routing.RecoverySource.SnapshotRecoverySource) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) ByteSizeValue(org.opensearch.common.unit.ByteSizeValue) HashMap(java.util.HashMap) RecoverySource(org.opensearch.cluster.routing.RecoverySource) ObjectObjectCursor(com.carrotsearch.hppc.cursors.ObjectObjectCursor) MapperService(org.opensearch.index.mapper.MapperService) IndexId(org.opensearch.repositories.IndexId) RecoveryState(org.opensearch.indices.recovery.RecoveryState) Directory(org.apache.lucene.store.Directory) Lucene(org.opensearch.common.lucene.Lucene) Translog(org.opensearch.index.translog.Translog) ActionListener(org.opensearch.action.ActionListener) UUIDs(org.opensearch.common.UUIDs) IOContext(org.apache.lucene.store.IOContext) Repository(org.opensearch.repositories.Repository) IndexShardRestoreFailedException(org.opensearch.index.snapshots.IndexShardRestoreFailedException) TimeValue(org.opensearch.common.unit.TimeValue) IndexInput(org.apache.lucene.store.IndexInput) Sort(org.apache.lucene.search.Sort) Index(org.opensearch.index.Index) ExceptionsHelper(org.opensearch.ExceptionsHelper) Set(java.util.Set) IOException(java.io.IOException) Store(org.opensearch.index.store.Store) Collectors(java.util.stream.Collectors) SegmentInfos(org.apache.lucene.index.SegmentInfos) Engine(org.opensearch.index.engine.Engine) Consumer(java.util.function.Consumer) IndexWriter(org.apache.lucene.index.IndexWriter) List(java.util.List) Logger(org.apache.logging.log4j.Logger) FilterDirectory(org.apache.lucene.store.FilterDirectory) StepListener(org.opensearch.action.StepListener) IndexWriterConfig(org.apache.lucene.index.IndexWriterConfig) IndexId(org.opensearch.repositories.IndexId) IndexShardRestoreFailedException(org.opensearch.index.snapshots.IndexShardRestoreFailedException) Store(org.opensearch.index.store.Store) EngineException(org.opensearch.index.engine.EngineException) IndexShardRestoreFailedException(org.opensearch.index.snapshots.IndexShardRestoreFailedException) IOException(java.io.IOException) StepListener(org.opensearch.action.StepListener) RecoveryState(org.opensearch.indices.recovery.RecoveryState)

Example 3 with IndexShardRestoreFailedException

use of org.opensearch.index.snapshots.IndexShardRestoreFailedException in project OpenSearch by opensearch-project.

the class FileRestoreContext method afterRestore.

private void afterRestore(SnapshotFiles snapshotFiles, Store store, StoreFileMetadata restoredSegmentsFile) {
    // read the snapshot data persisted
    try {
        Lucene.pruneUnreferencedFiles(restoredSegmentsFile.name(), store.directory());
    } catch (IOException e) {
        throw new IndexShardRestoreFailedException(shardId, "Failed to fetch index version after copying it over", e);
    }
    // / now, go over and clean files that are in the store, but were not in the snapshot
    try {
        for (String storeFile : store.directory().listAll()) {
            if (Store.isAutogenerated(storeFile) || snapshotFiles.containPhysicalIndexFile(storeFile)) {
                // skip write.lock, checksum files and files that exist in the snapshot
                continue;
            }
            try {
                store.deleteQuiet("restore", storeFile);
                store.directory().deleteFile(storeFile);
            } catch (IOException e) {
                logger.warn("[{}] [{}] failed to delete file [{}] during snapshot cleanup", shardId, snapshotId, storeFile);
            }
        }
    } catch (IOException e) {
        logger.warn("[{}] [{}] failed to list directory - some of files might not be deleted", shardId, snapshotId);
    }
}
Also used : IndexShardRestoreFailedException(org.opensearch.index.snapshots.IndexShardRestoreFailedException) IOException(java.io.IOException)

Example 4 with IndexShardRestoreFailedException

use of org.opensearch.index.snapshots.IndexShardRestoreFailedException in project OpenSearch by opensearch-project.

the class BlobStoreRepository method restoreShard.

@Override
public void restoreShard(Store store, SnapshotId snapshotId, IndexId indexId, ShardId snapshotShardId, RecoveryState recoveryState, ActionListener<Void> listener) {
    final ShardId shardId = store.shardId();
    final ActionListener<Void> restoreListener = ActionListener.delegateResponse(listener, (l, e) -> l.onFailure(new IndexShardRestoreFailedException(shardId, "failed to restore snapshot [" + snapshotId + "]", e)));
    final Executor executor = threadPool.executor(ThreadPool.Names.SNAPSHOT);
    final BlobContainer container = shardContainer(indexId, snapshotShardId);
    executor.execute(ActionRunnable.wrap(restoreListener, l -> {
        final BlobStoreIndexShardSnapshot snapshot = loadShardSnapshot(container, snapshotId);
        final SnapshotFiles snapshotFiles = new SnapshotFiles(snapshot.snapshot(), snapshot.indexFiles(), null);
        new FileRestoreContext(metadata.name(), shardId, snapshotId, recoveryState) {

            @Override
            protected void restoreFiles(List<BlobStoreIndexShardSnapshot.FileInfo> filesToRecover, Store store, ActionListener<Void> listener) {
                if (filesToRecover.isEmpty()) {
                    listener.onResponse(null);
                } else {
                    // Start as many workers as fit into the snapshot pool at once at the most
                    final int workers = Math.min(threadPool.info(ThreadPool.Names.SNAPSHOT).getMax(), snapshotFiles.indexFiles().size());
                    final BlockingQueue<BlobStoreIndexShardSnapshot.FileInfo> files = new LinkedBlockingQueue<>(filesToRecover);
                    final ActionListener<Void> allFilesListener = fileQueueListener(files, workers, ActionListener.map(listener, v -> null));
                    // restore the files from the snapshot to the Lucene store
                    for (int i = 0; i < workers; ++i) {
                        try {
                            executeOneFileRestore(files, allFilesListener);
                        } catch (Exception e) {
                            allFilesListener.onFailure(e);
                        }
                    }
                }
            }

            private void executeOneFileRestore(BlockingQueue<BlobStoreIndexShardSnapshot.FileInfo> files, ActionListener<Void> allFilesListener) throws InterruptedException {
                final BlobStoreIndexShardSnapshot.FileInfo fileToRecover = files.poll(0L, TimeUnit.MILLISECONDS);
                if (fileToRecover == null) {
                    allFilesListener.onResponse(null);
                } else {
                    executor.execute(ActionRunnable.wrap(allFilesListener, filesListener -> {
                        store.incRef();
                        try {
                            restoreFile(fileToRecover, store);
                        } finally {
                            store.decRef();
                        }
                        executeOneFileRestore(files, filesListener);
                    }));
                }
            }

            private void restoreFile(BlobStoreIndexShardSnapshot.FileInfo fileInfo, Store store) throws IOException {
                ensureNotClosing(store);
                logger.trace(() -> new ParameterizedMessage("[{}] restoring [{}] to [{}]", metadata.name(), fileInfo, store));
                boolean success = false;
                try (IndexOutput indexOutput = store.createVerifyingOutput(fileInfo.physicalName(), fileInfo.metadata(), IOContext.DEFAULT)) {
                    if (fileInfo.name().startsWith(VIRTUAL_DATA_BLOB_PREFIX)) {
                        final BytesRef hash = fileInfo.metadata().hash();
                        indexOutput.writeBytes(hash.bytes, hash.offset, hash.length);
                        recoveryState.getIndex().addRecoveredBytesToFile(fileInfo.physicalName(), hash.length);
                    } else {
                        try (InputStream stream = maybeRateLimitRestores(new SlicedInputStream(fileInfo.numberOfParts()) {

                            @Override
                            protected InputStream openSlice(int slice) throws IOException {
                                ensureNotClosing(store);
                                return container.readBlob(fileInfo.partName(slice));
                            }
                        })) {
                            final byte[] buffer = new byte[Math.toIntExact(Math.min(bufferSize, fileInfo.length()))];
                            int length;
                            while ((length = stream.read(buffer)) > 0) {
                                ensureNotClosing(store);
                                indexOutput.writeBytes(buffer, 0, length);
                                recoveryState.getIndex().addRecoveredBytesToFile(fileInfo.physicalName(), length);
                            }
                        }
                    }
                    Store.verify(indexOutput);
                    indexOutput.close();
                    store.directory().sync(Collections.singleton(fileInfo.physicalName()));
                    success = true;
                } catch (CorruptIndexException | IndexFormatTooOldException | IndexFormatTooNewException ex) {
                    try {
                        store.markStoreCorrupted(ex);
                    } catch (IOException e) {
                        logger.warn("store cannot be marked as corrupted", e);
                    }
                    throw ex;
                } finally {
                    if (success == false) {
                        store.deleteQuiet(fileInfo.physicalName());
                    }
                }
            }

            void ensureNotClosing(final Store store) throws AlreadyClosedException {
                assert store.refCount() > 0;
                if (store.isClosing()) {
                    throw new AlreadyClosedException("store is closing");
                }
            }
        }.restore(snapshotFiles, store, l);
    }));
}
Also used : Metadata(org.opensearch.cluster.metadata.Metadata) IndexFormatTooNewException(org.apache.lucene.index.IndexFormatTooNewException) AllocationService(org.opensearch.cluster.routing.allocation.AllocationService) AlreadyClosedException(org.apache.lucene.store.AlreadyClosedException) Version(org.opensearch.Version) Strings(org.opensearch.common.Strings) AbortedSnapshotException(org.opensearch.snapshots.AbortedSnapshotException) GroupedActionListener(org.opensearch.action.support.GroupedActionListener) RecoveryState(org.opensearch.indices.recovery.RecoveryState) Map(java.util.Map) Lucene(org.opensearch.common.lucene.Lucene) ActionListener(org.opensearch.action.ActionListener) IOContext(org.apache.lucene.store.IOContext) Repository(org.opensearch.repositories.Repository) TimeValue(org.opensearch.common.unit.TimeValue) ExceptionsHelper(org.opensearch.ExceptionsHelper) Set(java.util.Set) Settings(org.opensearch.common.settings.Settings) BlobStoreIndexShardSnapshot(org.opensearch.index.snapshots.blobstore.BlobStoreIndexShardSnapshot) BlockingQueue(java.util.concurrent.BlockingQueue) AbstractLifecycleComponent(org.opensearch.common.component.AbstractLifecycleComponent) Logger(org.apache.logging.log4j.Logger) RepositoryOperation(org.opensearch.repositories.RepositoryOperation) Stream(java.util.stream.Stream) ClusterStateUpdateTask(org.opensearch.cluster.ClusterStateUpdateTask) BytesArray(org.opensearch.common.bytes.BytesArray) BlobStoreIndexShardSnapshots(org.opensearch.index.snapshots.blobstore.BlobStoreIndexShardSnapshots) FsBlobContainer(org.opensearch.common.blobstore.fs.FsBlobContainer) StepListener(org.opensearch.action.StepListener) XContentType(org.opensearch.common.xcontent.XContentType) IndexCommit(org.apache.lucene.index.IndexCommit) ThreadPool(org.opensearch.threadpool.ThreadPool) BlobContainer(org.opensearch.common.blobstore.BlobContainer) Releasable(org.opensearch.common.lease.Releasable) Supplier(java.util.function.Supplier) ArrayList(java.util.ArrayList) ClusterState(org.opensearch.cluster.ClusterState) SnapshotMissingException(org.opensearch.snapshots.SnapshotMissingException) Numbers(org.opensearch.common.Numbers) SlicedInputStream(org.opensearch.index.snapshots.blobstore.SlicedInputStream) SnapshotException(org.opensearch.snapshots.SnapshotException) Streams(org.opensearch.common.io.Streams) CompressorFactory(org.opensearch.common.compress.CompressorFactory) RepositoryVerificationException(org.opensearch.repositories.RepositoryVerificationException) RepositoryCleanupInProgress(org.opensearch.cluster.RepositoryCleanupInProgress) InputStreamIndexInput(org.opensearch.common.lucene.store.InputStreamIndexInput) LongStream(java.util.stream.LongStream) IndexInput(org.apache.lucene.store.IndexInput) SetOnce(org.apache.lucene.util.SetOnce) RepositoriesMetadata(org.opensearch.cluster.metadata.RepositoriesMetadata) Executor(java.util.concurrent.Executor) SnapshotInfo(org.opensearch.snapshots.SnapshotInfo) RepositoryMetadata(org.opensearch.cluster.metadata.RepositoryMetadata) IOException(java.io.IOException) IndexShardSnapshotFailedException(org.opensearch.index.snapshots.IndexShardSnapshotFailedException) NotXContentException(org.opensearch.common.compress.NotXContentException) AtomicLong(java.util.concurrent.atomic.AtomicLong) RepositoryCleanupResult(org.opensearch.repositories.RepositoryCleanupResult) BlobPath(org.opensearch.common.blobstore.BlobPath) NamedXContentRegistry(org.opensearch.common.xcontent.NamedXContentRegistry) ClusterService(org.opensearch.cluster.service.ClusterService) CounterMetric(org.opensearch.common.metrics.CounterMetric) ShardGenerations(org.opensearch.repositories.ShardGenerations) NoSuchFileException(java.nio.file.NoSuchFileException) AbstractRunnable(org.opensearch.common.util.concurrent.AbstractRunnable) SnapshotCreationException(org.opensearch.snapshots.SnapshotCreationException) ByteSizeUnit(org.opensearch.common.unit.ByteSizeUnit) SnapshotFiles(org.opensearch.index.snapshots.blobstore.SnapshotFiles) SnapshotsService(org.opensearch.snapshots.SnapshotsService) CorruptIndexException(org.apache.lucene.index.CorruptIndexException) ConcurrentCollections(org.opensearch.common.util.concurrent.ConcurrentCollections) XContentParser(org.opensearch.common.xcontent.XContentParser) DiscoveryNode(org.opensearch.cluster.node.DiscoveryNode) MapperService(org.opensearch.index.mapper.MapperService) IndexId(org.opensearch.repositories.IndexId) XContentFactory(org.opensearch.common.xcontent.XContentFactory) RepositoryStats(org.opensearch.repositories.RepositoryStats) BlobMetadata(org.opensearch.common.blobstore.BlobMetadata) RecoverySettings(org.opensearch.indices.recovery.RecoverySettings) RepositoryException(org.opensearch.repositories.RepositoryException) FileInfo.canonicalName(org.opensearch.index.snapshots.blobstore.BlobStoreIndexShardSnapshot.FileInfo.canonicalName) BytesRef(org.apache.lucene.util.BytesRef) SnapshotId(org.opensearch.snapshots.SnapshotId) Collection(java.util.Collection) LoggingDeprecationHandler(org.opensearch.common.xcontent.LoggingDeprecationHandler) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) Store(org.opensearch.index.store.Store) LinkedBlockingQueue(java.util.concurrent.LinkedBlockingQueue) Collectors(java.util.stream.Collectors) Nullable(org.opensearch.common.Nullable) Tuple(org.opensearch.common.collect.Tuple) BlobStore(org.opensearch.common.blobstore.BlobStore) List(java.util.List) Optional(java.util.Optional) BytesReference(org.opensearch.common.bytes.BytesReference) RateLimitingInputStream(org.opensearch.index.snapshots.blobstore.RateLimitingInputStream) IndexMetadata(org.opensearch.cluster.metadata.IndexMetadata) ActionRunnable(org.opensearch.action.ActionRunnable) SnapshotsInProgress(org.opensearch.cluster.SnapshotsInProgress) ByteSizeValue(org.opensearch.common.unit.ByteSizeValue) SnapshotDeletionsInProgress(org.opensearch.cluster.SnapshotDeletionsInProgress) ParameterizedMessage(org.apache.logging.log4j.message.ParameterizedMessage) AtomicReference(java.util.concurrent.atomic.AtomicReference) Function(java.util.function.Function) FilterInputStream(java.io.FilterInputStream) IndexShardSnapshotStatus(org.opensearch.index.snapshots.IndexShardSnapshotStatus) IndexMetaDataGenerations(org.opensearch.repositories.IndexMetaDataGenerations) UUIDs(org.opensearch.common.UUIDs) StoreFileMetadata(org.opensearch.index.store.StoreFileMetadata) IndexOutput(org.apache.lucene.store.IndexOutput) IndexShardRestoreFailedException(org.opensearch.index.snapshots.IndexShardRestoreFailedException) RepositoryData(org.opensearch.repositories.RepositoryData) Setting(org.opensearch.common.settings.Setting) RepositoryShardId(org.opensearch.repositories.RepositoryShardId) IndexFormatTooOldException(org.apache.lucene.index.IndexFormatTooOldException) ShardId(org.opensearch.index.shard.ShardId) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) DeleteResult(org.opensearch.common.blobstore.DeleteResult) LogManager(org.apache.logging.log4j.LogManager) Collections(java.util.Collections) RateLimiter(org.apache.lucene.store.RateLimiter) InputStream(java.io.InputStream) BlobStoreIndexShardSnapshot(org.opensearch.index.snapshots.blobstore.BlobStoreIndexShardSnapshot) IndexShardRestoreFailedException(org.opensearch.index.snapshots.IndexShardRestoreFailedException) Store(org.opensearch.index.store.Store) BlobStore(org.opensearch.common.blobstore.BlobStore) AlreadyClosedException(org.apache.lucene.store.AlreadyClosedException) LinkedBlockingQueue(java.util.concurrent.LinkedBlockingQueue) RepositoryShardId(org.opensearch.repositories.RepositoryShardId) ShardId(org.opensearch.index.shard.ShardId) SnapshotFiles(org.opensearch.index.snapshots.blobstore.SnapshotFiles) Executor(java.util.concurrent.Executor) IndexFormatTooOldException(org.apache.lucene.index.IndexFormatTooOldException) ArrayList(java.util.ArrayList) List(java.util.List) BytesRef(org.apache.lucene.util.BytesRef) BlockingQueue(java.util.concurrent.BlockingQueue) LinkedBlockingQueue(java.util.concurrent.LinkedBlockingQueue) SlicedInputStream(org.opensearch.index.snapshots.blobstore.SlicedInputStream) RateLimitingInputStream(org.opensearch.index.snapshots.blobstore.RateLimitingInputStream) FilterInputStream(java.io.FilterInputStream) InputStream(java.io.InputStream) CorruptIndexException(org.apache.lucene.index.CorruptIndexException) IndexOutput(org.apache.lucene.store.IndexOutput) IOException(java.io.IOException) IndexFormatTooNewException(org.apache.lucene.index.IndexFormatTooNewException) AlreadyClosedException(org.apache.lucene.store.AlreadyClosedException) AbortedSnapshotException(org.opensearch.snapshots.AbortedSnapshotException) SnapshotMissingException(org.opensearch.snapshots.SnapshotMissingException) SnapshotException(org.opensearch.snapshots.SnapshotException) RepositoryVerificationException(org.opensearch.repositories.RepositoryVerificationException) IOException(java.io.IOException) IndexShardSnapshotFailedException(org.opensearch.index.snapshots.IndexShardSnapshotFailedException) NotXContentException(org.opensearch.common.compress.NotXContentException) NoSuchFileException(java.nio.file.NoSuchFileException) SnapshotCreationException(org.opensearch.snapshots.SnapshotCreationException) CorruptIndexException(org.apache.lucene.index.CorruptIndexException) RepositoryException(org.opensearch.repositories.RepositoryException) IndexShardRestoreFailedException(org.opensearch.index.snapshots.IndexShardRestoreFailedException) IndexFormatTooOldException(org.apache.lucene.index.IndexFormatTooOldException) GroupedActionListener(org.opensearch.action.support.GroupedActionListener) ActionListener(org.opensearch.action.ActionListener) FsBlobContainer(org.opensearch.common.blobstore.fs.FsBlobContainer) BlobContainer(org.opensearch.common.blobstore.BlobContainer) ParameterizedMessage(org.apache.logging.log4j.message.ParameterizedMessage) SlicedInputStream(org.opensearch.index.snapshots.blobstore.SlicedInputStream) IndexFormatTooNewException(org.apache.lucene.index.IndexFormatTooNewException)

Aggregations

IOException (java.io.IOException)4 IndexShardRestoreFailedException (org.opensearch.index.snapshots.IndexShardRestoreFailedException)4 List (java.util.List)3 Logger (org.apache.logging.log4j.Logger)3 ActionListener (org.opensearch.action.ActionListener)3 Lucene (org.opensearch.common.lucene.Lucene)3 Store (org.opensearch.index.store.Store)3 RecoveryState (org.opensearch.indices.recovery.RecoveryState)3 ArrayList (java.util.ArrayList)2 Arrays (java.util.Arrays)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 Set (java.util.Set)2 Consumer (java.util.function.Consumer)2 Collectors (java.util.stream.Collectors)2 IOContext (org.apache.lucene.store.IOContext)2 IndexInput (org.apache.lucene.store.IndexInput)2 ExceptionsHelper (org.opensearch.ExceptionsHelper)2 StepListener (org.opensearch.action.StepListener)2 IndexMetadata (org.opensearch.cluster.metadata.IndexMetadata)2