Skip to content

Commit 9aa340c

Browse files
authored
Fix indices shown in _cat/indices (#43286)
After two recent changes (#38824 and #33888), the _cat/indices API no longer report information for active recovering indices and non-replicated closed indices. It also misreport replicated closed indices that are potentially not authorized for the user. This commit changes how the cat action works by first using the Get Settings API in order to resolve authorized indices. It then uses the Cluster State, Cluster Health and Indices Stats APIs to retrieve information about the indices. Closes #39933
1 parent a9b9441 commit 9aa340c

File tree

5 files changed

+494
-249
lines changed

5 files changed

+494
-249
lines changed

server/src/main/java/org/elasticsearch/action/ActionModule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ public void initRestHandlers(Supplier<DiscoveryNodes> nodesInCluster) {
661661
registerHandler.accept(new RestMasterAction(settings, restController));
662662
registerHandler.accept(new RestNodesAction(settings, restController));
663663
registerHandler.accept(new RestTasksAction(settings, restController, nodesInCluster));
664-
registerHandler.accept(new RestIndicesAction(settings, restController, indexNameExpressionResolver));
664+
registerHandler.accept(new RestIndicesAction(settings, restController));
665665
registerHandler.accept(new RestSegmentsAction(settings, restController));
666666
// Fully qualified to prevent interference with rest.action.count.RestCountAction
667667
registerHandler.accept(new org.elasticsearch.rest.action.cat.RestCountAction(settings, restController));

0 commit comments

Comments
 (0)