elastic / elasticsearch

Free and Open Source, Distributed, RESTful Search Engine
https://www.elastic.co/products/elasticsearch
Other
1.1k stars 24.83k forks source link

ESQL: querying closed indices fails even with appropriate options set #106882

Open bpintea opened 7 months ago

bpintea commented 7 months ago

Description

Targeting a closed index (by itself or in a pattern with open indices) will fail in index resolution, irrespective of indices options. FROM open_index,close_index OPTIONS "ignore_unavailable"="true","allow_no_indices"="true" will produce

IndicesOptions[ignore_unavailable=true, allow_no_indices=true, expand_wildcards_open=true, expand_wildcards_closed=false, expand_wildcards_hidden=false, allow_aliases_to_multiple_indices=true, forbid_closed_indices=false, ignore_aliases=false, ignore_throttled=true, include_regular_indices=true, include_failure_indices=false, allow_failure_indices=true]

which will still fail with:

[2024-03-28T18:32:49,106][DEBUG][o.e.x.e.a.EsqlResponseListener] [runTask-0] Request failed with status [FORBIDDEN]: org.elasticsearch.cluster.block.ClusterBlockException: index [close_index] blocked by: [FORBIDDEN/4/index closed];
        at org.elasticsearch.server@8.14.0-SNAPSHOT/org.elasticsearch.cluster.block.ClusterBlocks.indicesBlockedException(ClusterBlocks.java:221)
        at org.elasticsearch.server@8.14.0-SNAPSHOT/org.elasticsearch.cluster.block.ClusterBlocks.indexBlockedException(ClusterBlocks.java:199)
        at org.elasticsearch.server@8.14.0-SNAPSHOT/org.elasticsearch.cluster.block.ClusterBlocks.indexBlockedRaiseException(ClusterBlocks.java:192)
        at org.elasticsearch.server@8.14.0-SNAPSHOT/org.elasticsearch.action.fieldcaps.TransportFieldCapabilitiesAction.checkIndexBlocks(TransportFieldCapabilitiesAction.java:264)
        at org.elasticsearch.server@8.14.0-SNAPSHOT/org.elasticsearch.action.fieldcaps.TransportFieldCapabilitiesAction.doExecuteForked(TransportFieldCapabilitiesAction.java:144)
        at org.elasticsearch.server@8.14.0-SNAPSHOT/org.elasticsearch.action.fieldcaps.TransportFieldCapabilitiesAction.lambda$doExecute$0(TransportFieldCapabilitiesAction.java:116)
        at org.elasticsearch.server@8.14.0-SNAPSHOT/org.elasticsearch.action.ActionRunnable$4.doRun(ActionRunnable.java:100)
        at org.elasticsearch.server@8.14.0-SNAPSHOT/org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
        at org.elasticsearch.server@8.14.0-SNAPSHOT/org.elasticsearch.common.util.concurrent.TimedRunnable.doRun(TimedRunnable.java:33)
        at org.elasticsearch.server@8.14.0-SNAPSHOT/org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:984)
        at org.elasticsearch.server@8.14.0-SNAPSHOT/org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at java.base/java.lang.Thread.run(Thread.java:1583)

Comparatively, a _search with ignore_unavailable=true will work.

elasticsearchmachine commented 7 months ago

Pinging @elastic/es-analytical-engine (Team:Analytics)

bpintea commented 7 months ago

Related: #106805

bpintea commented 6 months ago

Opened #107767.