TransportMasterNodeReadAction is intended for cases where we need to collect some state held only on the elected master, for instance related to shard allocation or data stream errors. However, many TransportMasterNodeReadAction implementations work as a pure function of the cluster state, which is held on every node, so there is no need to route these requests to the master for processing. Moreover, some of these requests may be quite expensive to process in large clusters, so routing them all to the master represents a scalability bottleneck. We should reconsider each usage of TransportMasterNodeReadAction and decide whether it needs to run on the master or not. If not, we should convert them to regular local-only transport actions (e.g. using TransportLocalClusterStateAction).
Additionally, many of these actions are not currently cancellable, but they (or at least the expensive ones) should be. Experience shows that we're not great at spotting the expensive ones ahead of time, so IMO we should err on the side of caution and make each one cancellable unless we have a good reason for not doing so.
Note that attempting to route these requests to the current master does not give them any stronger consistency guarantees, because the node that does the work does not validate that it is the master before responding. It's possible that a new master has been elected, and the cluster state updated, without the responding node knowing about it.
Relates #77466
TransportMasterNodeReadActionis intended for cases where we need to collect some state held only on the elected master, for instance related to shard allocation or data stream errors. However, manyTransportMasterNodeReadActionimplementations work as a pure function of the cluster state, which is held on every node, so there is no need to route these requests to the master for processing. Moreover, some of these requests may be quite expensive to process in large clusters, so routing them all to the master represents a scalability bottleneck. We should reconsider each usage ofTransportMasterNodeReadActionand decide whether it needs to run on the master or not. If not, we should convert them to regular local-only transport actions (e.g. usingTransportLocalClusterStateAction).Additionally, many of these actions are not currently cancellable, but they (or at least the expensive ones) should be. Experience shows that we're not great at spotting the expensive ones ahead of time, so IMO we should err on the side of caution and make each one cancellable unless we have a good reason for not doing so.
Note that attempting to route these requests to the current master does not give them any stronger consistency guarantees, because the node that does the work does not validate that it is the master before responding. It's possible that a new master has been elected, and the cluster state updated, without the responding node knowing about it.
TransportGetDataStreamsAction(org.elasticsearch.datastreams.action) RunTransportGetDataStreamsActionon local node #122852GetPipelineTransportAction(org.elasticsearch.action.ingest) RunGetPipelineTransportActionon local node #120445TransportClusterGetSettingsAction(org.elasticsearch.action.admin.cluster.settings) RunTransportClusterGetSettingsActionon local node #119831, see Reduce usage ofTransportClusterHealthAction(org.elasticsearch.action.admin.cluster.health)TransportMasterNodeReadAction#101805 (comment), see Reduce usage ofTransportClusterInfoAction(org.elasticsearch.action.support.master.info)TransportMasterNodeReadAction#101805 (comment)TransportClusterSearchShardsAction(org.elasticsearch.action.admin.cluster.shards)TransportClusterStateAction(org.elasticsearch.action.admin.cluster.state) RunTransportClusterStateActionon local node #129872TransportDeprecationInfoAction(org.elasticsearch.xpack.deprecation)TransportEnrichStatsAction(org.elasticsearch.xpack.enrich.action) RunTransportEnrichStatsActionon local node #121256, see RunTransportExplainDataStreamLifecycleAction(org.elasticsearch.datastreams.lifecycle.action)TransportExplainDataStreamLifecycleActionon local node #120567 (comment)TransportExplainLifecycleAction(org.elasticsearch.xpack.ilm.action) RunTransportExplainLifecycleActionon local node #122885TransportFollowInfoAction(org.elasticsearch.xpack.ccr.action)TransportGetAliasesAction(org.elasticsearch.action.admin.indices.alias.get) Run TransportGetAliasesAction on local node #101815TransportGetAnalyticsCollectionAction(org.elasticsearch.xpack.application.analytics.action)TransportGetAutoFollowPatternAction(org.elasticsearch.xpack.ccr.action)TransportGetBasicStatusAction(org.elasticsearch.license) TransportGetBasicStatusAction runs on local #137567TransportGetComponentTemplateAction(org.elasticsearch.action.admin.indices.template.get) Run TransportGetComponentTemplateAction on local node #116868TransportGetComposableIndexTemplateAction(org.elasticsearch.action.admin.indices.template.get) RunTransportGetComposableIndexTemplateon local node #119830TransportGetDataStreamLifecycleAction(org.elasticsearch.datastreams.lifecycle.action) RunTransportGetDataStreamLifecycleActionon local node #125214, depends onTransportGetDataStreamLifecycleStatsAction(org.elasticsearch.datastreams.lifecycle.action)DataStreamLifecycleErrorStorewhich only runs on the master node.TransportGetDataStreamOptionsAction(org.elasticsearch.datastreams.options.action) RunTransportGetDataStreamOptionsActionon local node #125213TransportGetDatafeedsAction(org.elasticsearch.xpack.ml.action), see Reduce usage ofTransportGetDesiredBalanceAction(org.elasticsearch.action.admin.cluster.allocation)TransportMasterNodeReadAction#101805 (comment)TransportGetDesiredNodesAction(org.elasticsearch.action.admin.cluster.desirednodes)TransportGetEnrichPolicyAction(org.elasticsearch.xpack.enrich.action) RunTransportGetEnrichPolicyActionon local node #121124TransportGetIndexAction(org.elasticsearch.action.admin.indices.get) RunTransportGetIndexActionon local node #125652TransportGetIndexTemplatesAction(org.elasticsearch.action.admin.indices.template.get) RunTransportGetIndexTemplatesActionon local node #119837TransportGetJobModelSnapshotsUpgradeStatsAction(org.elasticsearch.xpack.ml.action)TransportGetJobsAction(org.elasticsearch.xpack.ml.action)TransportGetLicenseAction(org.elasticsearch.license)TransportGetLifecycleAction(org.elasticsearch.xpack.ilm.action) RunTransportGetLifecycleActionon local node #126002TransportGetMappingsAction(org.elasticsearch.action.admin.indices.mapping.get) RunTransportGetMappingsActionon local node #122921TransportGetRepositoriesAction(org.elasticsearch.action.admin.cluster.repositories.get)TransportGetSettingsAction(org.elasticsearch.action.admin.indices.settings.get) RunTransportGetSettingsActionon local node #126051TransportGetStatusAction(org.elasticsearch.xpack.ilm.action) RunTransportGetStatusActionon local node #129367TransportGetStoredScriptAction(org.elasticsearch.action.admin.cluster.storedscripts)TransportGetTrialStatusAction(org.elasticsearch.license)TransportGetWatcherSettingsAction(org.elasticsearch.xpack.watcher.transport.actions) RunTransportGetWatcherSettingsActionon local node #122857TransportIndicesShardStoresAction(org.elasticsearch.action.admin.indices.shards)TransportPendingClusterTasksAction(org.elasticsearch.action.admin.cluster.tasks)TransportPrevalidateNodeRemovalAction(org.elasticsearch.action.admin.cluster.node.shutdown)TransportSimulateIndexTemplateAction(org.elasticsearch.action.admin.indices.template.post) Run template simulation actions on local node #120038TransportSimulateTemplateAction(org.elasticsearch.action.admin.indices.template.post) Run template simulation actions on local node #120038TransportXPackUsageActionand all inheritors ofXPackUsageFeatureTransportAction(various packages) Run XPack usage actions on local node #122933TransportMasterNodeReadActionimplementations added since this list was createdRelates #77466