-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Make TransportGetSnapshotLifecycleStatsAction project aware #132289
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
base: main
Are you sure you want to change the base?
Make TransportGetSnapshotLifecycleStatsAction project aware #132289
Conversation
…otLifecycleStatsAction
…otLifecycleStatsAction
…otLifecycleStatsAction
…otLifecycleStatsAction
Pinging @elastic/es-data-management (Team:Data Management) |
There was a problem hiding this 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 :)
if (input.getTransportVersion().onOrAfter(SLM_GET_STATS_CHANGE_REQUEST_TYPE)) { | ||
return new Request(input); |
There was a problem hiding this comment.
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:
Lines 48 to 52 in d8257b4
public Request(StreamInput in) throws IOException { | |
super(in, false); | |
// Read and ignore ack timeout. | |
in.readTimeValue(); | |
} |
There was a problem hiding this comment.
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.
Make TransportGetSnapshotLifecycleStatsAction project aware, also make it read from local cluster state instead of calling the master node since the state is available locally.