Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix transport serialization of EnrichStatsAction.Request #121735

Merged
merged 4 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -382,9 +382,6 @@ tests:
- class: org.elasticsearch.xpack.esql.action.CrossClustersCancellationIT
method: testCancelSkipUnavailable
issue: https://github.com/elastic/elasticsearch/issues/121631
- class: org.elasticsearch.upgrades.UpgradeClusterClientYamlTestSuiteIT
method: test {p0=mixed_cluster/110_enrich/Enrich stats query smoke test for mixed cluster}
issue: https://github.com/elastic/elasticsearch/issues/121642
- class: org.elasticsearch.search.CrossClusterSearchUnavailableClusterIT
method: testSearchSkipUnavailable
issue: https://github.com/elastic/elasticsearch/issues/121497
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,23 @@ protected LocalClusterStateRequest(TimeValue masterTimeout) {
*/
@UpdateForV10(owner = UpdateForV10.Owner.DISTRIBUTED_COORDINATION)
protected LocalClusterStateRequest(StreamInput in) throws IOException {
this(in, true);
}

/**
* This constructor exists solely for BwC purposes. It should exclusively be used by requests that used to extend
* {@link org.elasticsearch.action.support.master.MasterNodeRequest} and still need to be able to serialize incoming request.
*/
@UpdateForV10(owner = UpdateForV10.Owner.DISTRIBUTED_COORDINATION)
protected LocalClusterStateRequest(StreamInput in, boolean readLocal) throws IOException {
super(in);
masterTimeout = in.readTimeValue();
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) {
in.readVLong();
}
in.readBoolean();
if (readLocal) {
in.readBoolean();
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,13 @@ public Request(TimeValue masterNodeTimeout) {
}

/**
* NB prior to 9.0 this was a TransportMasterNodeReadAction so for BwC we must remain able to read these requests until
* NB prior to 9.0 this was a TransportMasterNodeAction so for BwC we must remain able to read these requests until
* we no longer need to support calling this action remotely.
*/
@UpdateForV10(owner = UpdateForV10.Owner.DATA_MANAGEMENT)
public Request(StreamInput in) throws IOException {
super(in);
// This request extended MasterNodeRequest instead of MasterNodeReadRequest, meaning that it didn't serialize the `local` field.
super(in, false);
}

@Override
Expand Down Expand Up @@ -90,7 +91,7 @@ public List<CacheStats> getCacheStats() {
}

/**
* NB prior to 9.0 this was a TransportMasterNodeReadAction so for BwC we must remain able to write these responses until
* NB prior to 9.0 this was a TransportMasterNodeAction so for BwC we must remain able to write these responses until
* we no longer need to support calling this action remotely.
*/
@UpdateForV10(owner = UpdateForV10.Owner.DATA_MANAGEMENT)
Expand Down Expand Up @@ -181,7 +182,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
public record ExecutingPolicy(String name, TaskInfo taskInfo) implements Writeable, ToXContentFragment {

/**
* NB prior to 9.0 this was a TransportMasterNodeReadAction so for BwC we must remain able to write these responses until
* NB prior to 9.0 this was a TransportMasterNodeAction so for BwC we must remain able to write these responses until
* we no longer need to support calling this action remotely.
*/
@UpdateForV10(owner = UpdateForV10.Owner.DATA_MANAGEMENT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class TransportEnrichStatsAction extends TransportLocalClusterStateAction
private final Client client;

/**
* NB prior to 9.0 this was a TransportMasterNodeReadAction so for BwC it must be registered with the TransportService until
* NB prior to 9.0 this was a TransportMasterNodeAction so for BwC it must be registered with the TransportService until
* we no longer need to support calling this action remotely.
*/
@UpdateForV10(owner = UpdateForV10.Owner.DATA_MANAGEMENT)
Expand Down