Skip to content

Commit ba07eb4

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 05689de commit ba07eb4

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ public void initRestHandlers(Supplier<DiscoveryNodes> nodesInCluster) {
651651
registerHandler.accept(new RestMasterAction(settings, restController));
652652
registerHandler.accept(new RestNodesAction(settings, restController));
653653
registerHandler.accept(new RestTasksAction(settings, restController, nodesInCluster));
654-
registerHandler.accept(new RestIndicesAction(settings, restController, indexNameExpressionResolver));
654+
registerHandler.accept(new RestIndicesAction(settings, restController));
655655
registerHandler.accept(new RestSegmentsAction(settings, restController));
656656
// Fully qualified to prevent interference with rest.action.count.RestCountAction
657657
registerHandler.accept(new org.elasticsearch.rest.action.cat.RestCountAction(settings, restController));

0 commit comments

Comments
 (0)