Skip to content

[PROPOSAL] Eliminate all Transport calls from Extensions to OpenSearch #767

Open
@dbwiddis

Description

@dbwiddis

What/Why

What are you proposing?

Extensions presently rely on transport calls to OpenSearch for both initialization and ongoing actions. This requires the extension to maintain an open (and secure) network connection with OpenSearch.

Originating Transport connections from OpenSearch to an extension is a reasonable option (but see #746 for a discussion of making this an optional alternative to REST or other (gRPC?) communication layer). However, an Extension making a transport call back to OpenSearch introduces multiple complexities such as:

  • It needs a host and port to connect to, and these are often/likely secured inside a private network behind a load balancer, bastion host, or other security layer
  • It only connects to one of multiple cluster managers, so the Extension's state (registered actions, registered REST handlers, etc.) are only updated on one cluster manager
  • It requires the extension to identify itself and introduces the complexity of sharing certificates/keys/etc.

All of the initialization calls can be replaced by a response to the initialization call.

Other uses of transport should be replaced by equivalent REST requests.

What users have asked for this feature?

This issue was highlighted during performance testing setup (#652) and has prompted still-unfixed bugs associated with the lack of valid OpenSearch IP address (#761) and collisions with transport service headers (#771). A continuous connection also is incompatible with a serverless design (#746).

What problems are you trying to solve?

  • Additional complexity with security, and a "back door" potential for disrupting the cluster outside a load balancer
  • The need to maintain (and monitor and recover from failure of) a connection between Extensions and OpenSearch
  • Resource exhaustion/resource leaks with a connection port per extension instance
  • The single-point-of-failure with extensions only communicating with a single OpenSearch cluster manager and the need to replicate any changes
  • The need to maintain a state, which blocks development of serverless solutions

What is the developer experience going to be?

SDK developers will need to rely on the REST layer for any communications originated to OpenSearch

OpenSearch will need a new REST endpoint for extensions to communicate with; however the byte streams used can be the same "Writeable" or protobuf bytes, just in the body of an HTTP request.

Extension developers will see no change; all extension communication was already intended to be over REST.

Are there any security considerations?

This should reduce the security considerations of having both REST and Transport, making the communications only via REST.

Are there any breaking changes to the API

We are still pre-release behind a feature flag so it's in line with the continuously changing breaking development.

What is the user experience going to be?

Users will not have to know any of the complex details of where nodes live and how they are reachable. They simply provide a single endpoint, probably a load balancer, and the SDK handles the rest.

Are there breaking changes to the User Experience?

No users have experienced it yet!

Why should it be built? Any reason not to?

It's a good solution to a wide range of problems that would avoid many other patchwork fixes.

What will it take to execute?

Replace existing Transport calls originating from Extensions with alternatives.

The following call occurs during initialization and should be replaced by including the information into the Initialization Request class:

  • sendEnvironmentSettingsRequest()

The following calls occur during initialization and should be replaced by including the information they communicate into the initialization Response class:

  • sendRegisterRestActionsRequest()
  • sendRegisterCustomSettingsRequest()
  • sendRegisterTransportActionsRequest()

The following calls are presently unimplemented, planned for the future:

  • sendExtensionDependencyRequest() could be included as part of initialization request
  • sendClusterSettingsRequest() could be easily replaced by a REST call

The following calls occur as part of calls from the SDKClient and its ecosystem. These implementations would be the hardest part of this proposal.

Any remaining open questions?

This should likely be part of a larger-scale integrated design for serverless which will employ a similar transport/REST/gRPC equivalent in the other direction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    RFCIssues requesting major changesenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions