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

[META] [FEATURE] Design and build forward compatibility and backward compatibility for SDK #338

Closed
2 tasks done
Tracked by #337
ryanbogan opened this issue Jan 13, 2023 · 2 comments
Closed
2 tasks done
Tracked by #337
Assignees
Labels
enhancement New feature or request Meta

Comments

@ryanbogan
Copy link
Member

ryanbogan commented Jan 13, 2023

The SDK must be able to function properly no matter what versions of the SDK or OpenSearch the user is running. We need to design and build a system that can accomplish this goal.

@ryanbogan ryanbogan added enhancement New feature or request untriaged labels Jan 13, 2023
@ryanbogan ryanbogan changed the title [FEATURE] Add backwards and forwards compatibility with versions for the SDK [FEATURE] Design and build forward compatibility and backward compatibility for SDK Jan 13, 2023
@ryanbogan
Copy link
Member Author

ryanbogan commented Jan 13, 2023

To simulate backwards compatibility, I added a new String parameter to AcknowledgedResponse in the OpenSearch repo, and ran the HelloWorld extension with this change. Neither OpenSearch nor the SDK crashed, but the extension was not initialized due to the following exception:

java.lang.IllegalStateException: Message not fully read (response) for requestId [3], handler [org.opensearch.transport.TransportService$ContextRestoreResponseHandler/org.opensearch.sdk.handlers.AcknowledgedResponseHandler@3b87747c], error [false]; resetting

@ryanbogan ryanbogan self-assigned this Jan 13, 2023
@dbwiddis
Copy link
Member

Can't help debug without code, but the issue is that if you're adding a new parameter you need to make it optional, which generally means if you're doing a Writeable transport request you need to either use the existing writeOptionalString() or equivalent; or manually do the optional bit by writing a boolean and then only if the boolean is true, the writeable object.

See how ExtensionRequest was implemented in opensearch-project/OpenSearch#5658

@dbwiddis dbwiddis changed the title [FEATURE] Design and build forward compatibility and backward compatibility for SDK [META] [FEATURE] Design and build forward compatibility and backward compatibility for SDK Feb 6, 2023
@dbwiddis dbwiddis added the Meta label Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Meta
Projects
None yet
Development

No branches or pull requests

4 participants