-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Skip BaseNodesRequest
header without instantiation
#109682
Skip BaseNodesRequest
header without instantiation
#109682
Conversation
As described in elastic#100878 we sometimes send an unnecessary wrapped-up `BaseNodesRequest` to individual nodes for legacy reasons, and today we do that by calling its constructor and then discarding the resulting object. This commit introduces utilities for skipping and synthesizing the unnecessary data without involving `BaseNodesRequest` itself.
Pinging @elastic/es-distributed (Team:Distributed) |
…sRequest-skip-header
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.
LGTM
@Deprecated(forRemoval = true) | ||
protected BaseNodesRequest(StreamInput in) throws IOException { | ||
// A bare `BaseNodesRequest` is never sent over the wire, but several implementations send the full top-level request to each node | ||
// (wrapped up in another request). They shouldn't, but until we fix that we must keep this. See #100878. | ||
super(in); | ||
nodesIds = in.readStringArray(); | ||
concreteNodes = in.readOptionalArray(DiscoveryNode::new, DiscoveryNode[]::new); | ||
timeout = in.readOptionalTimeValue(); | ||
} |
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.
Should we replace its writeTo
method implementation with localOnly
?
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.
Yes, that's incoming in a follow-up.
Since elastic#109682 these requests are never sent or received over the wire, so we can drop all their `writeTo` implementations and forbid new actions from going over the wire by making the base class `writeTo` method final. Closes elastic#100878
As described in #100878 we sometimes send an unnecessary wrapped-up
BaseNodesRequest
to individual nodes for legacy reasons, and today wedo that by calling its constructor and then discarding the resulting
object. This commit introduces utilities for skipping and synthesizing
the unnecessary data without involving
BaseNodesRequest
itself.