diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/LicenseService.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/LicenseService.java index 779afed06c80a..67fa394546b96 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/LicenseService.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/LicenseService.java @@ -37,7 +37,6 @@ import org.elasticsearch.protocol.xpack.license.LicensesStatus; import org.elasticsearch.protocol.xpack.license.PutLicenseResponse; import org.elasticsearch.threadpool.ThreadPool; -import org.elasticsearch.xpack.core.XPackPlugin; import org.elasticsearch.xpack.core.XPackSettings; import java.nio.charset.StandardCharsets; @@ -300,7 +299,6 @@ protected PutLicenseResponse newResponse(boolean acknowledged) { @Override public ClusterState execute(ClusterState currentState) throws Exception { - XPackPlugin.checkReadyForXPackCustomMetadata(currentState); final Version oldestNodeVersion = currentState.nodes().getSmallestNonClientNodeVersion(); if (licenseIsCompatible(newLicense, oldestNodeVersion) == false) { throw new IllegalStateException( @@ -462,8 +460,7 @@ protected void doStart() throws ElasticsearchException { if (clusterService.lifecycleState() == Lifecycle.State.STARTED) { final ClusterState clusterState = clusterService.state(); if (clusterState.blocks().hasGlobalBlock(GatewayService.STATE_NOT_RECOVERED_BLOCK) == false - && clusterState.nodes().getMasterNode() != null - && XPackPlugin.isReadyForXPackCustomMetadata(clusterState)) { + && clusterState.nodes().getMasterNode() != null) { final LicensesMetadata currentMetadata = clusterState.metadata().custom(LicensesMetadata.TYPE); boolean noLicense = currentMetadata == null || currentMetadata.getLicense() == null; if (clusterState.getNodes().isLocalNodeElectedMaster() @@ -495,14 +492,6 @@ public void clusterChanged(ClusterChangedEvent event) { final ClusterState previousClusterState = event.previousState(); final ClusterState currentClusterState = event.state(); if (currentClusterState.blocks().hasGlobalBlock(GatewayService.STATE_NOT_RECOVERED_BLOCK) == false) { - if (XPackPlugin.isReadyForXPackCustomMetadata(currentClusterState) == false) { - logger.debug( - "cannot add license to cluster as the following nodes might not understand the license metadata: {}", - () -> XPackPlugin.nodesNotReadyForXPackCustomMetadata(currentClusterState) - ); - return; - } - final LicensesMetadata prevLicensesMetadata = previousClusterState.getMetadata().custom(LicensesMetadata.TYPE); final LicensesMetadata currentLicensesMetadata = currentClusterState.getMetadata().custom(LicensesMetadata.TYPE); // notify all interested plugins diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/StartBasicClusterTask.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/StartBasicClusterTask.java index b9356c71a212f..eaad496e3fbcd 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/StartBasicClusterTask.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/StartBasicClusterTask.java @@ -15,7 +15,6 @@ import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.cluster.node.DiscoveryNodes; import org.elasticsearch.core.Nullable; -import org.elasticsearch.xpack.core.XPackPlugin; import java.time.Clock; import java.util.Map; @@ -124,7 +123,6 @@ static class Executor implements ClusterStateTaskExecutor @Override public ClusterState execute(BatchExecutionContext batchExecutionContext) throws Exception { final var initialState = batchExecutionContext.initialState(); - XPackPlugin.checkReadyForXPackCustomMetadata(initialState); final LicensesMetadata originalLicensesMetadata = initialState.metadata().custom(LicensesMetadata.TYPE); var currentLicensesMetadata = originalLicensesMetadata; for (final var taskContext : batchExecutionContext.taskContexts()) { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/StartTrialClusterTask.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/StartTrialClusterTask.java index b6431ecd77c3a..10e3659bacf61 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/StartTrialClusterTask.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/StartTrialClusterTask.java @@ -15,7 +15,6 @@ import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.cluster.node.DiscoveryNodes; import org.elasticsearch.core.Nullable; -import org.elasticsearch.xpack.core.XPackPlugin; import java.time.Clock; import java.util.Collections; @@ -111,7 +110,6 @@ static class Executor implements ClusterStateTaskExecutor @Override public ClusterState execute(BatchExecutionContext batchExecutionContext) throws Exception { final var initialState = batchExecutionContext.initialState(); - XPackPlugin.checkReadyForXPackCustomMetadata(initialState); final LicensesMetadata originalLicensesMetadata = initialState.metadata().custom(LicensesMetadata.TYPE); var currentLicensesMetadata = originalLicensesMetadata; for (final var taskContext : batchExecutionContext.taskContexts()) { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/StartupSelfGeneratedLicenseTask.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/StartupSelfGeneratedLicenseTask.java index fb9305c7d24a1..8c63a52471ff2 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/StartupSelfGeneratedLicenseTask.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/StartupSelfGeneratedLicenseTask.java @@ -16,7 +16,6 @@ import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.Nullable; -import org.elasticsearch.xpack.core.XPackPlugin; import java.time.Clock; import java.util.UUID; @@ -51,7 +50,6 @@ public void clusterStateProcessed(ClusterState oldState, ClusterState newState) @Override public ClusterState execute(ClusterState currentState) throws Exception { - XPackPlugin.checkReadyForXPackCustomMetadata(currentState); final Metadata metadata = currentState.metadata(); final LicensesMetadata currentLicensesMetadata = metadata.custom(LicensesMetadata.TYPE); // do not generate a license if any license is present diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackPlugin.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackPlugin.java index 7faec97ab9195..f24ba30570831 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackPlugin.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackPlugin.java @@ -14,9 +14,7 @@ import org.elasticsearch.action.support.ActionFilter; import org.elasticsearch.action.support.TransportAction; import org.elasticsearch.client.internal.Client; -import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; -import org.elasticsearch.cluster.metadata.Metadata; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNodes; import org.elasticsearch.cluster.routing.allocation.AllocationService; @@ -33,7 +31,6 @@ import org.elasticsearch.common.settings.SettingsFilter; import org.elasticsearch.common.ssl.SslConfiguration; import org.elasticsearch.common.util.BigArrays; -import org.elasticsearch.core.Booleans; import org.elasticsearch.env.Environment; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.index.IndexSettingProvider; @@ -42,7 +39,6 @@ import org.elasticsearch.index.mapper.MetadataFieldMapper; import org.elasticsearch.indices.recovery.RecoverySettings; import org.elasticsearch.license.LicenseService; -import org.elasticsearch.license.LicensesMetadata; import org.elasticsearch.license.Licensing; import org.elasticsearch.license.XPackLicenseState; import org.elasticsearch.plugins.ClusterPlugin; @@ -78,18 +74,14 @@ import org.elasticsearch.xpack.core.action.XPackUsageResponse; import org.elasticsearch.xpack.core.async.DeleteAsyncResultAction; import org.elasticsearch.xpack.core.async.TransportDeleteAsyncResultAction; -import org.elasticsearch.xpack.core.ml.MlMetadata; import org.elasticsearch.xpack.core.rest.action.RestReloadAnalyzersAction; import org.elasticsearch.xpack.core.rest.action.RestXPackInfoAction; import org.elasticsearch.xpack.core.rest.action.RestXPackUsageAction; -import org.elasticsearch.xpack.core.security.authc.TokenMetadata; import org.elasticsearch.xpack.core.ssl.SSLConfigurationReloader; import org.elasticsearch.xpack.core.ssl.SSLService; import org.elasticsearch.xpack.core.termsenum.action.TermsEnumAction; import org.elasticsearch.xpack.core.termsenum.action.TransportTermsEnumAction; import org.elasticsearch.xpack.core.termsenum.rest.RestTermsEnumAction; -import org.elasticsearch.xpack.core.transform.TransformMetadata; -import org.elasticsearch.xpack.core.watcher.WatcherMetadata; import java.nio.file.Files; import java.nio.file.Path; @@ -104,7 +96,6 @@ import java.util.Optional; import java.util.function.LongSupplier; import java.util.function.Supplier; -import java.util.stream.Collectors; @SuppressWarnings("HiddenField") public class XPackPlugin extends XPackClientPlugin @@ -117,7 +108,6 @@ public class XPackPlugin extends XPackClientPlugin private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(XPackPlugin.class); public static final String ASYNC_RESULTS_INDEX = ".async-search"; - public static final String XPACK_INSTALLED_NODE_ATTR = "xpack.installed"; // TODO: clean up this library to not ask for write access to all system properties! static { @@ -227,72 +217,11 @@ public static LongSupplier getSharedEpochMillisSupplier() { return epochMillisSupplier.get(); } - /** - * Checks if the cluster state allows this node to add x-pack metadata to the cluster state, - * and throws an exception otherwise. - * This check should be called before installing any x-pack metadata to the cluster state, - * to ensure that the other nodes that are part of the cluster will be able to deserialize - * that metadata. Note that if the cluster state already contains x-pack metadata, this - * check assumes that the nodes are already ready to receive additional x-pack metadata. - * Having this check properly in place everywhere allows to install x-pack into a cluster - * using a rolling restart. - */ - public static void checkReadyForXPackCustomMetadata(ClusterState clusterState) { - if (alreadyContainsXPackCustomMetadata(clusterState)) { - return; - } - List notReadyNodes = nodesNotReadyForXPackCustomMetadata(clusterState); - if (notReadyNodes.isEmpty() == false) { - throw new IllegalStateException("The following nodes are not ready yet for enabling x-pack custom metadata: " + notReadyNodes); - } - } - - /** - * Checks if the cluster state allows this node to add x-pack metadata to the cluster state. - * See {@link #checkReadyForXPackCustomMetadata} for more details. - */ - public static boolean isReadyForXPackCustomMetadata(ClusterState clusterState) { - return alreadyContainsXPackCustomMetadata(clusterState) || nodesNotReadyForXPackCustomMetadata(clusterState).isEmpty(); - } - - /** - * Returns the list of nodes that won't allow this node from adding x-pack metadata to the cluster state. - * See {@link #checkReadyForXPackCustomMetadata} for more details. - */ - public static List nodesNotReadyForXPackCustomMetadata(ClusterState clusterState) { - // check that all nodes would be capable of deserializing newly added x-pack metadata - final List notReadyNodes = clusterState.nodes().stream().filter(node -> { - final String xpackInstalledAttr = node.getAttributes().getOrDefault(XPACK_INSTALLED_NODE_ATTR, "false"); - return Booleans.parseBoolean(xpackInstalledAttr) == false; - }).collect(Collectors.toList()); - - return notReadyNodes; - } - - private static boolean alreadyContainsXPackCustomMetadata(ClusterState clusterState) { - final Metadata metadata = clusterState.metadata(); - return metadata.custom(LicensesMetadata.TYPE) != null - || metadata.custom(MlMetadata.TYPE) != null - || metadata.custom(WatcherMetadata.TYPE) != null - || clusterState.custom(TokenMetadata.TYPE) != null - || metadata.custom(TransformMetadata.TYPE) != null; - } - @Override public Map getMetadataMappers() { return Map.of(DataTierFieldMapper.NAME, DataTierFieldMapper.PARSER); } - @Override - public Settings additionalSettings() { - final String xpackInstalledNodeAttrSetting = "node.attr." + XPACK_INSTALLED_NODE_ATTR; - - if (settings.get(xpackInstalledNodeAttrSetting) != null) { - throw new IllegalArgumentException("Directly setting [" + xpackInstalledNodeAttrSetting + "] is not permitted"); - } - return Settings.builder().put(super.additionalSettings()).put(xpackInstalledNodeAttrSetting, "true").build(); - } - @Override public Collection createComponents( Client client, diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/license/AbstractLicenseServiceTestCase.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/license/AbstractLicenseServiceTestCase.java index 479ce5a0b7e13..6d0ea82d23375 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/license/AbstractLicenseServiceTestCase.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/license/AbstractLicenseServiceTestCase.java @@ -20,15 +20,14 @@ import org.elasticsearch.test.ESTestCase; import org.elasticsearch.threadpool.TestThreadPool; import org.elasticsearch.threadpool.ThreadPool; -import org.elasticsearch.xpack.core.XPackPlugin; import org.elasticsearch.xpack.core.watcher.watch.ClockMock; import org.junit.After; import org.junit.Before; import java.util.stream.Stream; +import static java.util.Collections.emptyMap; import static java.util.Collections.emptySet; -import static java.util.Collections.singletonMap; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -84,13 +83,7 @@ protected void setInitialState(License license, XPackLicenseState licenseState, } protected DiscoveryNode getLocalNode() { - return new DiscoveryNode( - "b", - buildNewFakeTransportAddress(), - singletonMap(XPackPlugin.XPACK_INSTALLED_NODE_ATTR, "true"), - emptySet(), - Version.CURRENT - ); + return new DiscoveryNode("b", buildNewFakeTransportAddress(), emptyMap(), emptySet(), Version.CURRENT); } @After diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/XPackPluginTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/XPackPluginTests.java deleted file mode 100644 index df6bf758247af..0000000000000 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/XPackPluginTests.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ -package org.elasticsearch.xpack.core; - -import org.elasticsearch.Version; -import org.elasticsearch.client.internal.Client; -import org.elasticsearch.cluster.ClusterName; -import org.elasticsearch.cluster.ClusterState; -import org.elasticsearch.cluster.node.DiscoveryNode; -import org.elasticsearch.cluster.node.DiscoveryNodes; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.license.XPackLicenseState; -import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.xpack.core.security.authc.TokenMetadata; -import org.elasticsearch.xpack.core.ssl.SSLService; - -import java.util.Collections; -import java.util.Map; - -import static org.hamcrest.Matchers.containsString; - -public class XPackPluginTests extends ESTestCase { - - public void testXPackInstalledAttrClash() throws Exception { - Settings.Builder builder = Settings.builder(); - builder.put("node.attr." + XPackPlugin.XPACK_INSTALLED_NODE_ATTR, randomBoolean()); - if (randomBoolean()) { - builder.put(Client.CLIENT_TYPE_SETTING_S.getKey(), "transport"); - } - XPackPlugin xpackPlugin = createXPackPlugin(builder.put("path.home", createTempDir()).build()); - IllegalArgumentException e = expectThrows(IllegalArgumentException.class, xpackPlugin::additionalSettings); - assertThat( - e.getMessage(), - containsString("Directly setting [node.attr." + XPackPlugin.XPACK_INSTALLED_NODE_ATTR + "] is not permitted") - ); - } - - public void testXPackInstalledAttrExists() throws Exception { - XPackPlugin xpackPlugin = createXPackPlugin(Settings.builder().put("path.home", createTempDir()).build()); - assertEquals("true", xpackPlugin.additionalSettings().get("node.attr." + XPackPlugin.XPACK_INSTALLED_NODE_ATTR)); - } - - public void testNodesNotReadyForXPackCustomMetadata() { - boolean compatible; - boolean nodesCompatible = true; - DiscoveryNodes.Builder discoveryNodes = DiscoveryNodes.builder(); - - for (int i = 0; i < randomInt(3); i++) { - final Map attributes; - if (randomBoolean()) { - attributes = Collections.singletonMap(XPackPlugin.XPACK_INSTALLED_NODE_ATTR, "true"); - } else { - nodesCompatible = false; - attributes = Collections.emptyMap(); - } - - discoveryNodes.add( - new DiscoveryNode("node_" + i, buildNewFakeTransportAddress(), attributes, Collections.emptySet(), Version.CURRENT) - ); - } - ClusterState.Builder clusterStateBuilder = ClusterState.builder(ClusterName.DEFAULT); - - if (randomBoolean()) { - clusterStateBuilder.putCustom(TokenMetadata.TYPE, new TokenMetadata(Collections.emptyList(), new byte[0])); - compatible = true; - } else { - compatible = nodesCompatible; - } - - ClusterState clusterState = clusterStateBuilder.nodes(discoveryNodes.build()).build(); - - assertEquals(XPackPlugin.nodesNotReadyForXPackCustomMetadata(clusterState).isEmpty(), nodesCompatible); - assertEquals(XPackPlugin.isReadyForXPackCustomMetadata(clusterState), compatible); - - if (compatible == false) { - IllegalStateException e = expectThrows( - IllegalStateException.class, - () -> XPackPlugin.checkReadyForXPackCustomMetadata(clusterState) - ); - assertThat(e.getMessage(), containsString("The following nodes are not ready yet for enabling x-pack custom metadata:")); - } - } - - private XPackPlugin createXPackPlugin(Settings settings) throws Exception { - return new XPackPlugin(settings) { - - @Override - protected void setSslService(SSLService sslService) { - // disable - } - - @Override - protected void setLicenseState(XPackLicenseState licenseState) { - // disable - } - }; - } - -} diff --git a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/action/TransportPutRollupJobAction.java b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/action/TransportPutRollupJobAction.java index 29fa367bdc129..6c823395e553c 100644 --- a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/action/TransportPutRollupJobAction.java +++ b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/action/TransportPutRollupJobAction.java @@ -47,7 +47,6 @@ import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.ClientHelper; -import org.elasticsearch.xpack.core.XPackPlugin; import org.elasticsearch.xpack.core.rollup.RollupField; import org.elasticsearch.xpack.core.rollup.action.PutRollupJobAction; import org.elasticsearch.xpack.core.rollup.job.RollupJob; @@ -100,7 +99,6 @@ protected void masterOperation( ClusterState clusterState, ActionListener listener ) { - XPackPlugin.checkReadyForXPackCustomMetadata(clusterState); checkForDeprecatedTZ(request); FieldCapabilitiesRequest fieldCapsRequest = new FieldCapabilitiesRequest().indices(request.indices()) diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/TokenService.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/TokenService.java index a0df6288f2f4d..32ad2d0d48a04 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/TokenService.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/TokenService.java @@ -79,7 +79,6 @@ import org.elasticsearch.xcontent.XContentFactory; import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xpack.core.XPackField; -import org.elasticsearch.xpack.core.XPackPlugin; import org.elasticsearch.xpack.core.XPackSettings; import org.elasticsearch.xpack.core.security.ScrollHelper; import org.elasticsearch.xpack.core.security.SecurityContext; @@ -2374,14 +2373,7 @@ private void initialize(ClusterService clusterService) { } if (state.nodes().isLocalNodeElectedMaster()) { - if (XPackPlugin.isReadyForXPackCustomMetadata(state)) { - installTokenMetadata(state); - } else { - logger.debug( - "cannot add token metadata to cluster as the following nodes might not understand the metadata: {}", - () -> XPackPlugin.nodesNotReadyForXPackCustomMetadata(state) - ); - } + installTokenMetadata(state); } TokenMetadata custom = event.state().custom(TokenMetadata.TYPE); @@ -2406,8 +2398,6 @@ private void installTokenMetadata(ClusterState state) { submitUnbatchedTask("install-token-metadata", new ClusterStateUpdateTask(Priority.URGENT) { @Override public ClusterState execute(ClusterState currentState) { - XPackPlugin.checkReadyForXPackCustomMetadata(currentState); - if (currentState.custom(TokenMetadata.TYPE) == null) { return ClusterState.builder(currentState).putCustom(TokenMetadata.TYPE, getTokenMetadata()).build(); } else { diff --git a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/action/TransportPutTransformAction.java b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/action/TransportPutTransformAction.java index 877cd6ee2b7dd..31d9f6ce6e433 100644 --- a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/action/TransportPutTransformAction.java +++ b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/action/TransportPutTransformAction.java @@ -28,7 +28,6 @@ import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportService; import org.elasticsearch.xpack.core.ClientHelper; -import org.elasticsearch.xpack.core.XPackPlugin; import org.elasticsearch.xpack.core.XPackSettings; import org.elasticsearch.xpack.core.security.SecurityContext; import org.elasticsearch.xpack.core.transform.TransformMessages; @@ -91,7 +90,6 @@ public TransportPutTransformAction( @Override protected void masterOperation(Task task, Request request, ClusterState clusterState, ActionListener listener) { - XPackPlugin.checkReadyForXPackCustomMetadata(clusterState); useSecondaryAuthIfAvailable(securityContext, () -> { // set headers to run transform as calling user Map filteredHeaders = ClientHelper.getPersistableSafeSecurityHeaders( diff --git a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/action/TransportScheduleNowTransformAction.java b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/action/TransportScheduleNowTransformAction.java index 98918bb7dcc88..bf243e0ee75b3 100644 --- a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/action/TransportScheduleNowTransformAction.java +++ b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/action/TransportScheduleNowTransformAction.java @@ -25,7 +25,6 @@ import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.ActionNotFoundTransportException; import org.elasticsearch.transport.TransportService; -import org.elasticsearch.xpack.core.XPackPlugin; import org.elasticsearch.xpack.core.XPackSettings; import org.elasticsearch.xpack.core.security.SecurityContext; import org.elasticsearch.xpack.core.transform.action.ScheduleNowTransformAction; @@ -81,7 +80,6 @@ public TransportScheduleNowTransformAction( @Override protected void doExecute(Task task, Request request, ActionListener listener) { final ClusterState clusterState = clusterService.state(); - XPackPlugin.checkReadyForXPackCustomMetadata(clusterState); useSecondaryAuthIfAvailable(securityContext, () -> { ActionListener getTransformListener = ActionListener.wrap(unusedConfig -> { diff --git a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/action/TransportUpdateTransformAction.java b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/action/TransportUpdateTransformAction.java index 204e6488f2dc2..efc4ca8278ddd 100644 --- a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/action/TransportUpdateTransformAction.java +++ b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/action/TransportUpdateTransformAction.java @@ -29,7 +29,6 @@ import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportService; import org.elasticsearch.xpack.core.ClientHelper; -import org.elasticsearch.xpack.core.XPackPlugin; import org.elasticsearch.xpack.core.XPackSettings; import org.elasticsearch.xpack.core.security.SecurityContext; import org.elasticsearch.xpack.core.transform.action.UpdateTransformAction; @@ -99,7 +98,6 @@ public TransportUpdateTransformAction( @Override protected void doExecute(Task task, Request request, ActionListener listener) { final ClusterState clusterState = clusterService.state(); - XPackPlugin.checkReadyForXPackCustomMetadata(clusterState); final DiscoveryNodes nodes = clusterState.nodes(); diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/TransportWatcherServiceAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/TransportWatcherServiceAction.java index bfc0244e5f13f..9187f631e703c 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/TransportWatcherServiceAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/TransportWatcherServiceAction.java @@ -28,7 +28,6 @@ import org.elasticsearch.tasks.Task; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportService; -import org.elasticsearch.xpack.core.XPackPlugin; import org.elasticsearch.xpack.core.watcher.WatcherMetadata; import org.elasticsearch.xpack.core.watcher.transport.actions.service.WatcherServiceAction; import org.elasticsearch.xpack.core.watcher.transport.actions.service.WatcherServiceRequest; @@ -84,7 +83,6 @@ public TimeValue masterNodeTimeout() { }, listener) { @Override public ClusterState execute(ClusterState clusterState) { - XPackPlugin.checkReadyForXPackCustomMetadata(clusterState); WatcherMetadata newWatcherMetadata = new WatcherMetadata(manuallyStopped); WatcherMetadata currentMetadata = clusterState.metadata().custom(WatcherMetadata.TYPE);