Skip to content

Conversation

samxbr
Copy link
Contributor

@samxbr samxbr commented Jul 31, 2025

Make TransportGetSnapshotLifecycleStatsAction project aware, also make it read from local cluster state instead of calling the master node since the state is available locally.

@samxbr samxbr added >non-issue :Data Management/ILM+SLM Index and Snapshot lifecycle management labels Jul 31, 2025
@samxbr samxbr marked this pull request as ready for review August 19, 2025 17:02
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

@elasticsearchmachine elasticsearchmachine added the Team:Data Management Meta label for data/management team label Aug 19, 2025
Copy link
Contributor

@nielsbauman nielsbauman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for cleaning this up, @samxbr! I left two comments regarding (de)serialization, but other than that it looks good to me :)

Comment on lines +58 to +59
if (input.getTransportVersion().onOrAfter(SLM_GET_STATS_CHANGE_REQUEST_TYPE)) {
return new Request(input);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't actually need this transport version check (or the new transport version), as this branch will never fire. Any node that is on this transport version will execute the request locally, instead of forwarding it to the master node. Therefore, if we receive this request over the transport wire, we already know it's from an old node.

Also, we don't need this separate deserialization method, we can do this in the constructor like we do here:

public Request(StreamInput in) throws IOException {
super(in, false);
// Read and ignore ack timeout.
in.readTimeValue();
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can also remove the Response(StreamInput in) constructor below, as we'll know for sure that we'll never have to deserialize a response anymore (because any node on this version will run the request locally).

And can you add a @UpdateForV10(owner = UpdateForV10.Owner.DATA_MANAGEMENT) line to the Response#writeTo method? When we get to V10, we won't need that method either anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Data Management/ILM+SLM Index and Snapshot lifecycle management >non-issue Team:Data Management Meta label for data/management team v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants