Search in sources :

Example 41 with CorruptIndexException

use of org.apache.lucene.index.CorruptIndexException in project elasticsearch by elastic.

the class StreamOutput method writeException.

public void writeException(Throwable throwable) throws IOException {
    if (throwable == null) {
        writeBoolean(false);
    } else {
        writeBoolean(true);
        boolean writeCause = true;
        boolean writeMessage = true;
        if (throwable instanceof CorruptIndexException) {
            writeVInt(1);
            writeOptionalString(((CorruptIndexException) throwable).getOriginalMessage());
            writeOptionalString(((CorruptIndexException) throwable).getResourceDescription());
            writeMessage = false;
        } else if (throwable instanceof IndexFormatTooNewException) {
            writeVInt(2);
            writeOptionalString(((IndexFormatTooNewException) throwable).getResourceDescription());
            writeInt(((IndexFormatTooNewException) throwable).getVersion());
            writeInt(((IndexFormatTooNewException) throwable).getMinVersion());
            writeInt(((IndexFormatTooNewException) throwable).getMaxVersion());
            writeMessage = false;
            writeCause = false;
        } else if (throwable instanceof IndexFormatTooOldException) {
            writeVInt(3);
            IndexFormatTooOldException t = (IndexFormatTooOldException) throwable;
            writeOptionalString(t.getResourceDescription());
            if (t.getVersion() == null) {
                writeBoolean(false);
                writeOptionalString(t.getReason());
            } else {
                writeBoolean(true);
                writeInt(t.getVersion());
                writeInt(t.getMinVersion());
                writeInt(t.getMaxVersion());
            }
            writeMessage = false;
            writeCause = false;
        } else if (throwable instanceof NullPointerException) {
            writeVInt(4);
            writeCause = false;
        } else if (throwable instanceof NumberFormatException) {
            writeVInt(5);
            writeCause = false;
        } else if (throwable instanceof IllegalArgumentException) {
            writeVInt(6);
        } else if (throwable instanceof AlreadyClosedException) {
            writeVInt(7);
        } else if (throwable instanceof EOFException) {
            writeVInt(8);
            writeCause = false;
        } else if (throwable instanceof SecurityException) {
            writeVInt(9);
        } else if (throwable instanceof StringIndexOutOfBoundsException) {
            writeVInt(10);
            writeCause = false;
        } else if (throwable instanceof ArrayIndexOutOfBoundsException) {
            writeVInt(11);
            writeCause = false;
        } else if (throwable instanceof FileNotFoundException) {
            writeVInt(12);
            writeCause = false;
        } else if (throwable instanceof FileSystemException) {
            writeVInt(13);
            if (throwable instanceof NoSuchFileException) {
                writeVInt(0);
            } else if (throwable instanceof NotDirectoryException) {
                writeVInt(1);
            } else if (throwable instanceof DirectoryNotEmptyException) {
                writeVInt(2);
            } else if (throwable instanceof AtomicMoveNotSupportedException) {
                writeVInt(3);
            } else if (throwable instanceof FileAlreadyExistsException) {
                writeVInt(4);
            } else if (throwable instanceof AccessDeniedException) {
                writeVInt(5);
            } else if (throwable instanceof FileSystemLoopException) {
                writeVInt(6);
            } else {
                writeVInt(7);
            }
            writeOptionalString(((FileSystemException) throwable).getFile());
            writeOptionalString(((FileSystemException) throwable).getOtherFile());
            writeOptionalString(((FileSystemException) throwable).getReason());
            writeCause = false;
        } else if (throwable instanceof IllegalStateException) {
            writeVInt(14);
        } else if (throwable instanceof LockObtainFailedException) {
            writeVInt(15);
        } else if (throwable instanceof InterruptedException) {
            writeVInt(16);
            writeCause = false;
        } else if (throwable instanceof IOException) {
            writeVInt(17);
        } else {
            ElasticsearchException ex;
            if (throwable instanceof ElasticsearchException && ElasticsearchException.isRegistered(throwable.getClass(), version)) {
                ex = (ElasticsearchException) throwable;
            } else {
                ex = new NotSerializableExceptionWrapper(throwable);
            }
            writeVInt(0);
            writeVInt(ElasticsearchException.getId(ex.getClass()));
            ex.writeTo(this);
            return;
        }
        if (writeMessage) {
            writeOptionalString(throwable.getMessage());
        }
        if (writeCause) {
            writeException(throwable.getCause());
        }
        ElasticsearchException.writeStackTraces(throwable, this);
    }
}
Also used : FileAlreadyExistsException(java.nio.file.FileAlreadyExistsException) AccessDeniedException(java.nio.file.AccessDeniedException) FileNotFoundException(java.io.FileNotFoundException) NoSuchFileException(java.nio.file.NoSuchFileException) DirectoryNotEmptyException(java.nio.file.DirectoryNotEmptyException) AlreadyClosedException(org.apache.lucene.store.AlreadyClosedException) ElasticsearchException(org.elasticsearch.ElasticsearchException) FileSystemException(java.nio.file.FileSystemException) NotDirectoryException(java.nio.file.NotDirectoryException) IndexFormatTooOldException(org.apache.lucene.index.IndexFormatTooOldException) LockObtainFailedException(org.apache.lucene.store.LockObtainFailedException) EOFException(java.io.EOFException) AtomicMoveNotSupportedException(java.nio.file.AtomicMoveNotSupportedException) CorruptIndexException(org.apache.lucene.index.CorruptIndexException) IOException(java.io.IOException) IndexFormatTooNewException(org.apache.lucene.index.IndexFormatTooNewException) FileSystemLoopException(java.nio.file.FileSystemLoopException)

Example 42 with CorruptIndexException

use of org.apache.lucene.index.CorruptIndexException in project elasticsearch by elastic.

the class ChecksumBlobStoreFormat method readBlob.

/**
     * Reads blob with specified name without resolving the blobName using using {@link #blobName} method.
     *
     * @param blobContainer blob container
     * @param blobName blob name
     */
public T readBlob(BlobContainer blobContainer, String blobName) throws IOException {
    try (InputStream inputStream = blobContainer.readBlob(blobName)) {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        Streams.copy(inputStream, out);
        final byte[] bytes = out.toByteArray();
        final String resourceDesc = "ChecksumBlobStoreFormat.readBlob(blob=\"" + blobName + "\")";
        try (ByteArrayIndexInput indexInput = new ByteArrayIndexInput(resourceDesc, bytes)) {
            CodecUtil.checksumEntireFile(indexInput);
            CodecUtil.checkHeader(indexInput, codec, VERSION, VERSION);
            long filePointer = indexInput.getFilePointer();
            long contentSize = indexInput.length() - CodecUtil.footerLength() - filePointer;
            BytesReference bytesReference = new BytesArray(bytes, (int) filePointer, (int) contentSize);
            return read(bytesReference);
        } catch (CorruptIndexException | IndexFormatTooOldException | IndexFormatTooNewException ex) {
            // we trick this into a dedicated exception with the original stacktrace
            throw new CorruptStateException(ex);
        }
    }
}
Also used : BytesReference(org.elasticsearch.common.bytes.BytesReference) BytesArray(org.elasticsearch.common.bytes.BytesArray) InputStream(java.io.InputStream) CorruptIndexException(org.apache.lucene.index.CorruptIndexException) ByteArrayOutputStream(java.io.ByteArrayOutputStream) ByteArrayIndexInput(org.elasticsearch.common.lucene.store.ByteArrayIndexInput) IndexFormatTooOldException(org.apache.lucene.index.IndexFormatTooOldException) CorruptStateException(org.elasticsearch.gateway.CorruptStateException) IndexFormatTooNewException(org.apache.lucene.index.IndexFormatTooNewException)

Example 43 with CorruptIndexException

use of org.apache.lucene.index.CorruptIndexException in project elasticsearch by elastic.

the class IndicesShardStoreRequestIT method testCorruptedShards.

@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/12416")
public void testCorruptedShards() throws Exception {
    String index = "test";
    internalCluster().ensureAtLeastNumDataNodes(2);
    assertAcked(prepareCreate(index).setSettings(Settings.builder().put(IndexMetaData.SETTING_NUMBER_OF_SHARDS, "5").put(MockFSIndexStore.INDEX_CHECK_INDEX_ON_CLOSE_SETTING.getKey(), false)));
    indexRandomData(index);
    ensureGreen(index);
    logger.info("--> disable allocation");
    disableAllocation(index);
    logger.info("--> corrupt random shard copies");
    Map<Integer, Set<String>> corruptedShardIDMap = new HashMap<>();
    Index idx = resolveIndex(index);
    for (String node : internalCluster().nodesInclude(index)) {
        IndicesService indexServices = internalCluster().getInstance(IndicesService.class, node);
        IndexService indexShards = indexServices.indexServiceSafe(idx);
        for (Integer shardId : indexShards.shardIds()) {
            IndexShard shard = indexShards.getShard(shardId);
            if (randomBoolean()) {
                shard.failShard("test", new CorruptIndexException("test corrupted", ""));
                Set<String> nodes = corruptedShardIDMap.get(shardId);
                if (nodes == null) {
                    nodes = new HashSet<>();
                }
                nodes.add(node);
                corruptedShardIDMap.put(shardId, nodes);
            }
        }
    }
    IndicesShardStoresResponse rsp = client().admin().indices().prepareShardStores(index).setShardStatuses("all").get();
    ImmutableOpenIntMap<List<IndicesShardStoresResponse.StoreStatus>> shardStatuses = rsp.getStoreStatuses().get(index);
    assertNotNull(shardStatuses);
    assertThat(shardStatuses.size(), greaterThan(0));
    for (IntObjectCursor<List<IndicesShardStoresResponse.StoreStatus>> shardStatus : shardStatuses) {
        for (IndicesShardStoresResponse.StoreStatus status : shardStatus.value) {
            if (corruptedShardIDMap.containsKey(shardStatus.key) && corruptedShardIDMap.get(shardStatus.key).contains(status.getNode().getName())) {
                assertThat(status.getStoreException(), notNullValue());
            } else {
                assertNull(status.getStoreException());
            }
        }
    }
    logger.info("--> enable allocation");
    enableAllocation(index);
}
Also used : HashSet(java.util.HashSet) Set(java.util.Set) HashMap(java.util.HashMap) IndexService(org.elasticsearch.index.IndexService) IndexShard(org.elasticsearch.index.shard.IndexShard) IndicesService(org.elasticsearch.indices.IndicesService) CorruptIndexException(org.apache.lucene.index.CorruptIndexException) Index(org.elasticsearch.index.Index) List(java.util.List)

Example 44 with CorruptIndexException

use of org.apache.lucene.index.CorruptIndexException in project elasticsearch by elastic.

the class DiscoveryWithServiceDisruptionsIT method testSendingShardFailure.

// simulate handling of sending shard failure during an isolation
public void testSendingShardFailure() throws Exception {
    List<String> nodes = startCluster(3, 2);
    String masterNode = internalCluster().getMasterName();
    List<String> nonMasterNodes = nodes.stream().filter(node -> !node.equals(masterNode)).collect(Collectors.toList());
    String nonMasterNode = randomFrom(nonMasterNodes);
    assertAcked(prepareCreate("test").setSettings(Settings.builder().put(IndexMetaData.SETTING_NUMBER_OF_SHARDS, 3).put(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, 2)));
    ensureGreen();
    String nonMasterNodeId = internalCluster().clusterService(nonMasterNode).localNode().getId();
    // fail a random shard
    ShardRouting failedShard = randomFrom(clusterService().state().getRoutingNodes().node(nonMasterNodeId).shardsWithState(ShardRoutingState.STARTED));
    ShardStateAction service = internalCluster().getInstance(ShardStateAction.class, nonMasterNode);
    CountDownLatch latch = new CountDownLatch(1);
    AtomicBoolean success = new AtomicBoolean();
    String isolatedNode = randomBoolean() ? masterNode : nonMasterNode;
    TwoPartitions partitions = isolateNode(isolatedNode);
    // we cannot use the NetworkUnresponsive disruption type here as it will swallow the "shard failed" request, calling neither
    // onSuccess nor onFailure on the provided listener.
    NetworkLinkDisruptionType disruptionType = new NetworkDisconnect();
    NetworkDisruption networkDisruption = new NetworkDisruption(partitions, disruptionType);
    setDisruptionScheme(networkDisruption);
    networkDisruption.startDisrupting();
    service.localShardFailed(failedShard, "simulated", new CorruptIndexException("simulated", (String) null), new ShardStateAction.Listener() {

        @Override
        public void onSuccess() {
            success.set(true);
            latch.countDown();
        }

        @Override
        public void onFailure(Exception e) {
            success.set(false);
            latch.countDown();
            assert false;
        }
    });
    if (isolatedNode.equals(nonMasterNode)) {
        assertNoMaster(nonMasterNode);
    } else {
        ensureStableCluster(2, nonMasterNode);
    }
    // heal the partition
    networkDisruption.removeAndEnsureHealthy(internalCluster());
    // the cluster should stabilize
    ensureStableCluster(3);
    latch.await();
    // the listener should be notified
    assertTrue(success.get());
    // the failed shard should be gone
    List<ShardRouting> shards = clusterService().state().getRoutingTable().allShards("test");
    for (ShardRouting shard : shards) {
        assertThat(shard.allocationId(), not(equalTo(failedShard.allocationId())));
    }
}
Also used : Arrays(java.util.Arrays) Nullable(org.elasticsearch.common.Nullable) ZenDiscovery(org.elasticsearch.discovery.zen.ZenDiscovery) Matchers.not(org.hamcrest.Matchers.not) ZenPing(org.elasticsearch.discovery.zen.ZenPing) ClusterState(org.elasticsearch.cluster.ClusterState) ClusterStateUpdateTask(org.elasticsearch.cluster.ClusterStateUpdateTask) Scope(org.elasticsearch.test.ESIntegTestCase.Scope) ClusterBlock(org.elasticsearch.cluster.block.ClusterBlock) SlowClusterStateProcessing(org.elasticsearch.test.disruption.SlowClusterStateProcessing) Map(java.util.Map) Matchers.nullValue(org.hamcrest.Matchers.nullValue) ServiceDisruptionScheme(org.elasticsearch.test.disruption.ServiceDisruptionScheme) Priority(org.elasticsearch.common.Priority) TestLogging(org.elasticsearch.test.junit.annotations.TestLogging) Set(java.util.Set) ClusterDiscoveryConfiguration(org.elasticsearch.test.discovery.ClusterDiscoveryConfiguration) CountDownLatch(java.util.concurrent.CountDownLatch) Supplier(org.apache.logging.log4j.util.Supplier) IndexMetaData(org.elasticsearch.cluster.metadata.IndexMetaData) ShardStateAction(org.elasticsearch.cluster.action.shard.ShardStateAction) IntermittentLongGCDisruption(org.elasticsearch.test.disruption.IntermittentLongGCDisruption) Matchers.is(org.hamcrest.Matchers.is) TransportRequestOptions(org.elasticsearch.transport.TransportRequestOptions) TestZenDiscovery(org.elasticsearch.test.discovery.TestZenDiscovery) ClusterService(org.elasticsearch.cluster.service.ClusterService) ShardRoutingState(org.elasticsearch.cluster.routing.ShardRoutingState) MembershipAction(org.elasticsearch.discovery.zen.MembershipAction) ArrayList(java.util.ArrayList) DiscoveryNode(org.elasticsearch.cluster.node.DiscoveryNode) TcpTransport(org.elasticsearch.transport.TcpTransport) IndicesStoreIntegrationIT(org.elasticsearch.indices.store.IndicesStoreIntegrationIT) TransportService(org.elasticsearch.transport.TransportService) Before(org.junit.Before) ConnectionProfile(org.elasticsearch.transport.ConnectionProfile) DiscoveryNodes(org.elasticsearch.cluster.node.DiscoveryNodes) ClusterScope(org.elasticsearch.test.ESIntegTestCase.ClusterScope) Matchers.greaterThanOrEqualTo(org.hamcrest.Matchers.greaterThanOrEqualTo) Client(org.elasticsearch.client.Client) IOException(java.io.IOException) DocWriteResponse(org.elasticsearch.action.DocWriteResponse) ExecutionException(java.util.concurrent.ExecutionException) NetworkDisconnect(org.elasticsearch.test.disruption.NetworkDisruption.NetworkDisconnect) Tuple(org.elasticsearch.common.collect.Tuple) NetworkDelay(org.elasticsearch.test.disruption.NetworkDisruption.NetworkDelay) ElasticsearchAssertions.assertAcked(org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked) ElasticsearchException(org.elasticsearch.ElasticsearchException) GetResponse(org.elasticsearch.action.get.GetResponse) UnicastZenPing(org.elasticsearch.discovery.zen.UnicastZenPing) NetworkDisruption(org.elasticsearch.test.disruption.NetworkDisruption) TransportRequest(org.elasticsearch.transport.TransportRequest) CorruptIndexException(org.apache.lucene.index.CorruptIndexException) Settings(org.elasticsearch.common.settings.Settings) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) LongGCDisruption(org.elasticsearch.test.disruption.LongGCDisruption) XContentFactory.jsonBuilder(org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder) Bridge(org.elasticsearch.test.disruption.NetworkDisruption.Bridge) Collection(java.util.Collection) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HotThreads(org.elasticsearch.monitor.jvm.HotThreads) Collectors(java.util.stream.Collectors) Objects(java.util.Objects) List(java.util.List) IndexRequestBuilder(org.elasticsearch.action.index.IndexRequestBuilder) ESIntegTestCase(org.elasticsearch.test.ESIntegTestCase) NetworkUnresponsive(org.elasticsearch.test.disruption.NetworkDisruption.NetworkUnresponsive) INDEX_NUMBER_OF_REPLICAS_SETTING(org.elasticsearch.cluster.metadata.IndexMetaData.INDEX_NUMBER_OF_REPLICAS_SETTING) PublishClusterStateAction(org.elasticsearch.discovery.zen.PublishClusterStateAction) Matchers.equalTo(org.hamcrest.Matchers.equalTo) ElectMasterService(org.elasticsearch.discovery.zen.ElectMasterService) ShardRouting(org.elasticsearch.cluster.routing.ShardRouting) InternalTestCluster(org.elasticsearch.test.InternalTestCluster) XContentType(org.elasticsearch.common.xcontent.XContentType) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) HashMap(java.util.HashMap) ParameterizedMessage(org.apache.logging.log4j.message.ParameterizedMessage) FaultDetection(org.elasticsearch.discovery.zen.FaultDetection) AtomicReference(java.util.concurrent.atomic.AtomicReference) Strings(org.elasticsearch.common.Strings) HashSet(java.util.HashSet) TimeValue(org.elasticsearch.common.unit.TimeValue) IndexSettings(org.elasticsearch.index.IndexSettings) IndexResponse(org.elasticsearch.action.index.IndexResponse) MockTransportService(org.elasticsearch.test.transport.MockTransportService) ClusterBlockLevel(org.elasticsearch.cluster.block.ClusterBlockLevel) TwoPartitions(org.elasticsearch.test.disruption.NetworkDisruption.TwoPartitions) INDEX_NUMBER_OF_SHARDS_SETTING(org.elasticsearch.cluster.metadata.IndexMetaData.INDEX_NUMBER_OF_SHARDS_SETTING) DisruptedLinks(org.elasticsearch.test.disruption.NetworkDisruption.DisruptedLinks) Semaphore(java.util.concurrent.Semaphore) NetworkLinkDisruptionType(org.elasticsearch.test.disruption.NetworkDisruption.NetworkLinkDisruptionType) Plugin(org.elasticsearch.plugins.Plugin) NoShardAvailableActionException(org.elasticsearch.action.NoShardAvailableActionException) Murmur3HashFunction(org.elasticsearch.cluster.routing.Murmur3HashFunction) TimeUnit(java.util.concurrent.TimeUnit) SingleNodeDisruption(org.elasticsearch.test.disruption.SingleNodeDisruption) NodeEnvironment(org.elasticsearch.env.NodeEnvironment) Collections(java.util.Collections) NetworkLinkDisruptionType(org.elasticsearch.test.disruption.NetworkDisruption.NetworkLinkDisruptionType) TwoPartitions(org.elasticsearch.test.disruption.NetworkDisruption.TwoPartitions) CorruptIndexException(org.apache.lucene.index.CorruptIndexException) ShardStateAction(org.elasticsearch.cluster.action.shard.ShardStateAction) CountDownLatch(java.util.concurrent.CountDownLatch) NetworkDisconnect(org.elasticsearch.test.disruption.NetworkDisruption.NetworkDisconnect) IOException(java.io.IOException) ExecutionException(java.util.concurrent.ExecutionException) ElasticsearchException(org.elasticsearch.ElasticsearchException) CorruptIndexException(org.apache.lucene.index.CorruptIndexException) NoShardAvailableActionException(org.elasticsearch.action.NoShardAvailableActionException) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) ShardRouting(org.elasticsearch.cluster.routing.ShardRouting) NetworkDisruption(org.elasticsearch.test.disruption.NetworkDisruption)

Example 45 with CorruptIndexException

use of org.apache.lucene.index.CorruptIndexException in project elasticsearch by elastic.

the class IndexShardTests method testFailShard.

public void testFailShard() throws Exception {
    IndexShard shard = newStartedShard();
    final ShardPath shardPath = shard.shardPath();
    assertNotNull(shardPath);
    // fail shard
    shard.failShard("test shard fail", new CorruptIndexException("", ""));
    closeShards(shard);
    // check state file still exists
    ShardStateMetaData shardStateMetaData = load(logger, shardPath.getShardStatePath());
    assertEquals(shardStateMetaData, getShardStateMetadata(shard));
    // but index can't be opened for a failed shard
    assertThat("store index should be corrupted", Store.canOpenIndex(logger, shardPath.resolveIndex(), shard.shardId(), (shardId, lockTimeoutMS) -> new DummyShardLock(shardId)), equalTo(false));
}
Also used : MetaData(org.elasticsearch.cluster.metadata.MetaData) Versions(org.elasticsearch.common.lucene.uid.Versions) Arrays(java.util.Arrays) Releasables(org.elasticsearch.common.lease.Releasables) Term(org.apache.lucene.index.Term) AlreadyClosedException(org.apache.lucene.store.AlreadyClosedException) TranslogTests(org.elasticsearch.index.translog.TranslogTests) XContentBuilder(org.elasticsearch.common.xcontent.XContentBuilder) ParseContext(org.elasticsearch.index.mapper.ParseContext) EMPTY_REPO_GEN(org.elasticsearch.repositories.RepositoryData.EMPTY_REPO_GEN) Map(java.util.Map) Matchers.nullValue(org.hamcrest.Matchers.nullValue) UidFieldMapper(org.elasticsearch.index.mapper.UidFieldMapper) IOContext(org.apache.lucene.store.IOContext) Path(java.nio.file.Path) NumericDocValuesField(org.apache.lucene.document.NumericDocValuesField) PlainActionFuture(org.elasticsearch.action.support.PlainActionFuture) UUIDs(org.elasticsearch.common.UUIDs) Set(java.util.Set) Matchers.instanceOf(org.hamcrest.Matchers.instanceOf) RecoverySource(org.elasticsearch.cluster.routing.RecoverySource) SeqNoFieldMapper(org.elasticsearch.index.mapper.SeqNoFieldMapper) CountDownLatch(java.util.concurrent.CountDownLatch) AbstractRunnable(org.elasticsearch.common.util.concurrent.AbstractRunnable) Logger(org.apache.logging.log4j.Logger) IndexMetaData(org.elasticsearch.cluster.metadata.IndexMetaData) Matchers.greaterThan(org.hamcrest.Matchers.greaterThan) Matchers.containsString(org.hamcrest.Matchers.containsString) TestShardRouting(org.elasticsearch.cluster.routing.TestShardRouting) IndexCommit(org.apache.lucene.index.IndexCommit) FieldDataStats(org.elasticsearch.index.fielddata.FieldDataStats) SnapshotId(org.elasticsearch.snapshots.SnapshotId) SnapshotShardFailure(org.elasticsearch.snapshots.SnapshotShardFailure) BytesStreamOutput(org.elasticsearch.common.io.stream.BytesStreamOutput) ShardRoutingState(org.elasticsearch.cluster.routing.ShardRoutingState) ArrayList(java.util.ArrayList) BytesArray(org.elasticsearch.common.bytes.BytesArray) DiscoveryNode(org.elasticsearch.cluster.node.DiscoveryNode) SequenceNumbersService(org.elasticsearch.index.seqno.SequenceNumbersService) Store(org.elasticsearch.index.store.Store) BiConsumer(java.util.function.BiConsumer) Matchers.hasSize(org.hamcrest.Matchers.hasSize) EngineException(org.elasticsearch.index.engine.EngineException) TopDocs(org.apache.lucene.search.TopDocs) EMPTY_PARAMS(org.elasticsearch.common.xcontent.ToXContent.EMPTY_PARAMS) IOException(java.io.IOException) BrokenBarrierException(java.util.concurrent.BrokenBarrierException) UnassignedInfo(org.elasticsearch.cluster.routing.UnassignedInfo) ParsedDocument(org.elasticsearch.index.mapper.ParsedDocument) ExecutionException(java.util.concurrent.ExecutionException) Lucene.cleanLuceneIndex(org.elasticsearch.common.lucene.Lucene.cleanLuceneIndex) CommonStatsFlags(org.elasticsearch.action.admin.indices.stats.CommonStatsFlags) MappingMetaData(org.elasticsearch.cluster.metadata.MappingMetaData) ConcurrentCollections(org.elasticsearch.common.util.concurrent.ConcurrentCollections) IndicesQueryCache(org.elasticsearch.indices.IndicesQueryCache) SnapshotInfo(org.elasticsearch.snapshots.SnapshotInfo) VersionType(org.elasticsearch.index.VersionType) Matchers.hasKey(org.hamcrest.Matchers.hasKey) CorruptIndexException(org.apache.lucene.index.CorruptIndexException) Settings(org.elasticsearch.common.settings.Settings) ShardRoutingHelper(org.elasticsearch.cluster.routing.ShardRoutingHelper) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) MappedFieldType(org.elasticsearch.index.mapper.MappedFieldType) XContentFactory.jsonBuilder(org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder) ThreadPool(org.elasticsearch.threadpool.ThreadPool) NamedXContentRegistry(org.elasticsearch.common.xcontent.NamedXContentRegistry) Releasable(org.elasticsearch.common.lease.Releasable) CyclicBarrier(java.util.concurrent.CyclicBarrier) DirectoryReader(org.apache.lucene.index.DirectoryReader) BytesReference(org.elasticsearch.common.bytes.BytesReference) Collectors(java.util.stream.Collectors) Engine(org.elasticsearch.index.engine.Engine) List(java.util.List) Version(org.elasticsearch.Version) RecoveryState(org.elasticsearch.indices.recovery.RecoveryState) Matchers.equalTo(org.hamcrest.Matchers.equalTo) CommonStats(org.elasticsearch.action.admin.indices.stats.CommonStats) IndexReader(org.apache.lucene.index.IndexReader) IndexSearcher(org.apache.lucene.search.IndexSearcher) RepositoryData(org.elasticsearch.repositories.RepositoryData) ShardRouting(org.elasticsearch.cluster.routing.ShardRouting) IntStream(java.util.stream.IntStream) XContentType(org.elasticsearch.common.xcontent.XContentType) PRIMARY(org.elasticsearch.index.engine.Engine.Operation.Origin.PRIMARY) IndexShardSnapshotStatus(org.elasticsearch.index.snapshots.IndexShardSnapshotStatus) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) HashMap(java.util.HashMap) IndexId(org.elasticsearch.repositories.IndexId) AtomicReference(java.util.concurrent.atomic.AtomicReference) ForceMergeRequest(org.elasticsearch.action.admin.indices.forcemerge.ForceMergeRequest) HashSet(java.util.HashSet) ShardStats(org.elasticsearch.action.admin.indices.stats.ShardStats) Mapping(org.elasticsearch.index.mapper.Mapping) Collections.emptyMap(java.util.Collections.emptyMap) RepositoryMetaData(org.elasticsearch.cluster.metadata.RepositoryMetaData) Repository(org.elasticsearch.repositories.Repository) Uid(org.elasticsearch.index.mapper.Uid) Collections.emptySet(java.util.Collections.emptySet) Semaphore(java.util.concurrent.Semaphore) RecoveryTarget(org.elasticsearch.indices.recovery.RecoveryTarget) AbstractLifecycleComponent(org.elasticsearch.common.component.AbstractLifecycleComponent) FieldMaskingReader(org.elasticsearch.test.FieldMaskingReader) VersionUtils(org.elasticsearch.test.VersionUtils) TimeUnit(java.util.concurrent.TimeUnit) TermQuery(org.apache.lucene.search.TermQuery) FlushRequest(org.elasticsearch.action.admin.indices.flush.FlushRequest) Constants(org.apache.lucene.util.Constants) NodeEnvironment(org.elasticsearch.env.NodeEnvironment) Field(org.apache.lucene.document.Field) StreamInput(org.elasticsearch.common.io.stream.StreamInput) IndexFieldData(org.elasticsearch.index.fielddata.IndexFieldData) Translog(org.elasticsearch.index.translog.Translog) AllocationId(org.elasticsearch.cluster.routing.AllocationId) DummyShardLock(org.elasticsearch.test.DummyShardLock) Snapshot(org.elasticsearch.snapshots.Snapshot) Collections(java.util.Collections) CorruptIndexException(org.apache.lucene.index.CorruptIndexException) DummyShardLock(org.elasticsearch.test.DummyShardLock)

Aggregations

CorruptIndexException (org.apache.lucene.index.CorruptIndexException)64 ChecksumIndexInput (org.apache.lucene.store.ChecksumIndexInput)19 IndexFormatTooNewException (org.apache.lucene.index.IndexFormatTooNewException)17 IndexFormatTooOldException (org.apache.lucene.index.IndexFormatTooOldException)17 Directory (org.apache.lucene.store.Directory)16 IndexInput (org.apache.lucene.store.IndexInput)16 IndexOutput (org.apache.lucene.store.IndexOutput)15 IOException (java.io.IOException)14 ArrayList (java.util.ArrayList)9 FileNotFoundException (java.io.FileNotFoundException)8 RAMDirectory (org.apache.lucene.store.RAMDirectory)8 BytesRef (org.apache.lucene.util.BytesRef)8 EOFException (java.io.EOFException)7 HashMap (java.util.HashMap)7 IOContext (org.apache.lucene.store.IOContext)7 NoSuchFileException (java.nio.file.NoSuchFileException)6 AlreadyClosedException (org.apache.lucene.store.AlreadyClosedException)6 List (java.util.List)5 ElasticsearchException (org.elasticsearch.ElasticsearchException)5 AccessDeniedException (java.nio.file.AccessDeniedException)4