Ensure enrich executes on master node only (#46448)

The previous transport action was a read action, which under the right
set of circumstances can execute on a coordinating node. This commit
ensures that cannot happen.
This commit is contained in:
Michael Basnight 2019-09-10 09:58:54 -05:00
parent c057fce978
commit 9304f5c889
2 changed files with 4 additions and 4 deletions

View File

@ -8,7 +8,7 @@ package org.elasticsearch.xpack.core.enrich.action;
import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.action.support.master.MasterNodeReadRequest; import org.elasticsearch.action.support.master.MasterNodeRequest;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
@ -24,7 +24,7 @@ public class ExecuteEnrichPolicyAction extends ActionType<AcknowledgedResponse>
super(NAME, AcknowledgedResponse::new); super(NAME, AcknowledgedResponse::new);
} }
public static class Request extends MasterNodeReadRequest<Request> { public static class Request extends MasterNodeRequest<Request> {
private final String name; private final String name;

View File

@ -8,7 +8,7 @@ package org.elasticsearch.xpack.enrich.action;
import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.action.support.master.TransportMasterNodeReadAction; import org.elasticsearch.action.support.master.TransportMasterNodeAction;
import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.block.ClusterBlockException; import org.elasticsearch.cluster.block.ClusterBlockException;
import org.elasticsearch.cluster.block.ClusterBlockLevel; import org.elasticsearch.cluster.block.ClusterBlockLevel;
@ -25,7 +25,7 @@ import org.elasticsearch.xpack.enrich.PolicyExecutionResult;
import java.io.IOException; import java.io.IOException;
public class TransportExecuteEnrichPolicyAction public class TransportExecuteEnrichPolicyAction
extends TransportMasterNodeReadAction<ExecuteEnrichPolicyAction.Request, AcknowledgedResponse> { extends TransportMasterNodeAction<ExecuteEnrichPolicyAction.Request, AcknowledgedResponse> {
private final EnrichPolicyExecutor executor; private final EnrichPolicyExecutor executor;