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

Document an overview of action names and how they're used in the transport layer #100229

Open
DaveCTurner opened this issue Oct 3, 2023 · 3 comments
Labels
:Distributed/Network Http and internode communication implementations Team:Distributed Meta label for distributed team >tech debt

Comments

@DaveCTurner
Copy link
Contributor

As noted at #100162 (comment) we don't really have any great overview docs about how transport actions are registered and used.

The Javadocs for org.elasticsearch.transport.TransportHandshaker describe the message format of transport handshakes which are pretty similar to regular transport message but we should have something similar about regular transport messages too. The key point there is that the action name is included (in plain ASCII) in the header (see org.elasticsearch.transport.Header) and we use that string to pick the handler from the map of registered handlers:

final String action = header.getActionName();
final long requestId = header.getRequestId();
final RequestHandlerRegistry<T> reg = requestHandlers.getHandler(action);

@DaveCTurner DaveCTurner added :Distributed/Network Http and internode communication implementations >tech debt labels Oct 3, 2023
@elasticsearchmachine elasticsearchmachine added the Team:Distributed Meta label for distributed team label Oct 3, 2023
@elasticsearchmachine
Copy link
Collaborator

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

@DiannaHohensee
Copy link
Contributor

IIUC, each TransportAction has a actionName, like this, and these paths/names/commands are registered someplace via the TransportService (?). Then when a node receives a transport layer request, either from another cluster node or internally, the actionName is looked up in some map that will cause the appropriate TransportAction to be invoked? I'm guessing the Handler naming convention is in reference to Netty and ChannelHandler extensions/implementations?

Not necessary to answer this now, but maybe this will give whomever picks this task up an additional clue as to what would be helpful to document.

@DaveCTurner
Copy link
Contributor Author

these paths/names/commands are registered someplace

Specifically they're held in org.elasticsearch.transport.Transport.RequestHandlers#requestHandlers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed/Network Http and internode communication implementations Team:Distributed Meta label for distributed team >tech debt
Projects
None yet
Development

No branches or pull requests

3 participants