-
Notifications
You must be signed in to change notification settings - Fork 25.5k
Simplify TransportBroadcastByNodeAction #93484
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
Merged
elasticsearchmachine
merged 5 commits into
elastic:main
from
DaveCTurner:2023-02-02-BroadcastByNodeAction-streamlining
Feb 7, 2023
Merged
Simplify TransportBroadcastByNodeAction #93484
elasticsearchmachine
merged 5 commits into
elastic:main
from
DaveCTurner:2023-02-02-BroadcastByNodeAction-streamlining
Feb 7, 2023
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Similarly to elastic#92987, recent improvements to the primitives for writing async code (particularly elastic#92452 and elastic#92620) mean that we can enormously simplify `TransportBroadcastByNodeAction`. In particular, we can avoid accumulating an intermediate array of responses for later processing in favour of just accumulating the successes and failures into their final separate lists. We also no longer need to use a separate `NodesResponseTracker` to discard responses on cancellation. Finally, we can now discard shard-level responses more promptly on cancellation.
Pinging @elastic/es-data-management (Team:Data Management) |
gmarouli
approved these changes
Feb 7, 2023
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, great to see this code simplified and I really like the naming pattern executeAsCoordinatingNode
and executeAsDataNode
! 🚀
@elasticmachine update branch |
DaveCTurner
added a commit
to DaveCTurner/elasticsearch
that referenced
this pull request
May 23, 2023
Each `TransportTasksAction` fans-out to multiple nodes, accumulates responses and retains them until all the nodes have responded, and then converts the responses into a final result. Similarly to elastic#92987 and elastic#93484, we should accumulate the responses in a structure that doesn't require so much copying later on, and should drop the received responses if the task is cancelled while some nodes' responses are still pending.
DaveCTurner
added a commit
to DaveCTurner/elasticsearch
that referenced
this pull request
May 26, 2023
We have this somewhat-complex pattern in 3 places already, and elastic#96279 will introduce a couple more, so this commit extracts it as a dedicated utility. Relates elastic#92987 Relates elastic#93484
DaveCTurner
added a commit
that referenced
this pull request
May 26, 2023
elasticsearchmachine
pushed a commit
that referenced
this pull request
May 30, 2023
Each `TransportTasksAction` fans-out to multiple nodes, accumulates responses and retains them until all the nodes have responded, and then converts the responses into a final result. Similarly to #92987 and #93484, we should accumulate the responses in a structure that doesn't require so much copying later on, and should drop the received responses if the task is cancelled while some nodes' responses are still pending.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
auto-merge-without-approval
Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!)
:Data Management/Stats
Statistics tracking and retrieval APIs
>refactoring
Team:Data Management
Meta label for data/management team
v8.7.0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Similarly to #92987, recent improvements to the primitives for writing async code (particularly #92452 and #92620) mean that we can enormously simplify
TransportBroadcastByNodeAction
. In particular, we can avoid accumulating an intermediate array of responses for later processing in favour of just accumulating the successes and failures into their final separate lists. We also no longer need to use a separateNodesResponseTracker
to discard responses on cancellation. Finally, we can now discard shard-level responses more promptly on cancellation.