diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexNameExpressionResolver.java b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexNameExpressionResolver.java index 459c6c6ec733e..b945fe7e510f6 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/IndexNameExpressionResolver.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/IndexNameExpressionResolver.java @@ -567,17 +567,14 @@ private static boolean shouldTrackConcreteIndex(Context context, IndicesOptions // Exclude this one as it's a net-new system index, and we explicitly don't want those. return false; } - if (DataStream.isFailureStoreFeatureFlagEnabled()) { - IndexAbstraction indexAbstraction = context.getState().metadata().getIndicesLookup().get(index.getName()); - if (context.options.allowFailureIndices() == false) { - DataStream parentDataStream = indexAbstraction.getParentDataStream(); - if (parentDataStream != null && parentDataStream.isFailureStoreEnabled()) { - if (parentDataStream.isFailureStoreIndex(index.getName())) { - if (options.ignoreUnavailable()) { - return false; - } else { - throw new FailureIndexNotSupportedException(index); - } + if (DataStream.isFailureStoreFeatureFlagEnabled() && context.options.allowFailureIndices() == false) { + DataStream parentDataStream = context.getState().metadata().getIndicesLookup().get(index.getName()).getParentDataStream(); + if (parentDataStream != null && parentDataStream.isFailureStoreEnabled()) { + if (parentDataStream.isFailureStoreIndex(index.getName())) { + if (options.ignoreUnavailable()) { + return false; + } else { + throw new FailureIndexNotSupportedException(index); } } } diff --git a/server/src/main/java/org/elasticsearch/indices/SystemIndices.java b/server/src/main/java/org/elasticsearch/indices/SystemIndices.java index 3261ac83a7e67..bafbd57a607a5 100644 --- a/server/src/main/java/org/elasticsearch/indices/SystemIndices.java +++ b/server/src/main/java/org/elasticsearch/indices/SystemIndices.java @@ -562,11 +562,10 @@ public static SystemIndexAccessLevel getSystemIndexAccessLevel(ThreadContext thr // This method intentionally cannot return BACKWARDS_COMPATIBLE_ONLY - that access level should only be used manually // in known special cases. final String headerValue = threadContext.getHeader(SYSTEM_INDEX_ACCESS_CONTROL_HEADER_KEY); - final String productHeaderValue = threadContext.getHeader(EXTERNAL_SYSTEM_INDEX_ACCESS_CONTROL_HEADER_KEY); final boolean allowed = Booleans.parseBoolean(headerValue, true); if (allowed) { - if (productHeaderValue != null) { + if (threadContext.getHeader(EXTERNAL_SYSTEM_INDEX_ACCESS_CONTROL_HEADER_KEY) != null) { return SystemIndexAccessLevel.RESTRICTED; } else { return SystemIndexAccessLevel.ALL;