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

Skip BaseNodesRequest header without instantiation #109682

Merged

Conversation

DaveCTurner
Copy link
Contributor

As described in #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.

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.
@DaveCTurner DaveCTurner added >non-issue :Distributed Indexing/Distributed A catch all label for anything in the Distributed Area. Please avoid if you can. v8.15.0 labels Jun 13, 2024
@elasticsearchmachine elasticsearchmachine added the Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. label Jun 13, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (Team:Distributed)

@DaveCTurner DaveCTurner requested review from ywangd and removed request for DiannaHohensee June 16, 2024 19:30
Copy link
Member

@ywangd ywangd left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines -49 to -57
@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();
}
Copy link
Member

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?

Copy link
Contributor Author

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.

@DaveCTurner DaveCTurner merged commit 0a7c99b into elastic:main Jun 17, 2024
15 checks passed
@DaveCTurner DaveCTurner deleted the 2024/06/12/BaseNodesRequest-skip-header branch June 17, 2024 03:57
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Jun 17, 2024
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
DaveCTurner added a commit that referenced this pull request Jun 17, 2024
Since #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 #100878
@DaveCTurner DaveCTurner restored the 2024/06/12/BaseNodesRequest-skip-header branch June 17, 2024 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed Indexing/Distributed A catch all label for anything in the Distributed Area. Please avoid if you can. >non-issue Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. v8.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants