-
Notifications
You must be signed in to change notification settings - Fork 33
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
Introduce protocol versioning #421
Introduce protocol versioning #421
Conversation
PR Review ChecklistDo not edit the content of this comment. The PR reviewer should simply update this comment by ticking each review item below, as they get completed. Trivial Change
Code
Architecture
|
6917980
to
f5474eb
Compare
public static final Client RPC_METHOD_UNAVAILABLE = | ||
new Client(1, "The server does not support this method, please check the client-server compatibility:\n'%s'."); |
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.
This error message could be friendlier, something like
"The server does not support this method. Please ensure that the TypeDB Client and TypeDB Server versions are compatible ..."
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.
Will push an update, thank you!
@@ -85,6 +93,11 @@ private static boolean isPasswordCredentialExpired(StatusRuntimeException status | |||
statusRuntimeException.getStatus().getDescription() != null && | |||
statusRuntimeException.getStatus().getDescription().contains(CLUSTER_PASSWORD_CREDENTIAL_EXPIRED_ERROR_CODE); | |||
} | |||
|
|||
private static boolean isUnimplementedMethod(StatusRuntimeException statusRuntimeException) { | |||
return statusRuntimeException.getStatus().getCode() == Status.Code.UNIMPLEMENTED; |
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.
This is a sufficient but not necessary condition for a client-server mismatch error. It's also possible that we send a request message with an RPC code that is implemented, but carries a different semantic meaning in this protocol version.
Do we perform some kind of handshake anywhere to verify the protocol version? I notice OpenReq
now sends a version number. Does that mean the server will decline a connection request from an invalid client?
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.
Yep, and it throws basically the equivalent error message if it is a mismatch :) between the two of them we should get pretty good coverage of client-protocol mismatches -> useful errors the users can resolve by themselves.
## What is the goal of this PR? We update the Rust driver to support the features introduced in driver Java since v2.19 in effort to preserve the feature set when transitioning from the JVM-native implementation to the Rust JNI implementation. ## What are the changes implemented in this PR? Changes in master since branching (#417): Reimplemented in Rust and made available in Java over JNI: - #409 - #421 - 1f396a6 Improve method unavailable error message - #430 - #431: partial, since `tonic` does not report SSL errors to the same granularity Cherry-picked directly: - #415 - 42800e7 Update VERSION to 2.18.1 - 7cd0a5a Add eclipsesource-minimal-json to maven dependencies (#423) - 63614ec Update CODEOWNERS - #424 Dropped entirely (Java-specific or obsolete): - #422 - 8c0caa1 Update VERSION and release notes --------- Co-authored-by: Benjamin Small <benjaminasmall@gmail.com> Co-authored-by: joshua <joshua@vaticle.com> Co-authored-by: Krishnan Govindraj <krishnangovindraj@users.noreply.github.com>
What is the goal of this PR?
We use a new protocol API to perform a "connection open". This API does server-side protocol version compatibility checks, and replaces our previous need to get all databases to check that the connection is available.
The user will receive an error about a protocol version mismatch if they are using a client-server combination that are not using exactly compatible protocols.
Both errors imply a client-server mismatch and the error will suggest this as a fix.
This change depends on typedb/typedb-protocol#185, which means that this client will implement protocol version 1.
What are the changes implemented in this PR?
validateConnectionOrThrow
intoopenConnection
, was then inlined into the constructors ofCoreClient
andClusterServerClient
openConnection
with the protocol Version set when constructing a clientunimplemented
error