-
Notifications
You must be signed in to change notification settings - Fork 139
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
GC Tool is mixing v1 and v2 URLs #6805
Comments
This may be an overkill. URLs are not required to have this suffix in custom deployments. |
Since GC requires API v2 now, I guess we could validate the URL using the |
While this should work to distinguish a URL mismatch between v1 and v2 endpoints, I think this is a little brittle. E.g. when a v3 is introduced, both v2 and v3 will support I will provide a quick fix using your suggestion, which should be good enough for now, but I think we should come up with a more robust way to detect this kind of mismatch in the future. |
We could still use the spec version value, I guess, but I agree, this needs some more thinking. |
Could we? Imagine a V3 server returning:
We want to detect the situation where a client is created with NessieApi client =
HttpClientBuilder.builder()
.withUri("http://localhost:19120/api/v2")
.build(NessieApiV3.class); The above client will break as soon as it tries to invoke a v3 endpoint that does not exist under the |
It’s effectively just a wrong default IIUC, let’s fix that one. We don’t have any v3 yet, not even an idea how it could look like. |
What happened:
Since #5660 GC tool switched to V2 api by default, but it seems to be mixing V1 and V2 URLs:
The above v1 URL does not exist, but there is a matching v2 one. The request is simply trying to read the commitlog for the given reference, using v2
getCommitLog
REST endpoint, but the URI prefix is wrong.As a consequence the router is mistakenly matching the request against the v1
assignReference
REST endpoint, which expects a PUT method, not GET – hence the 405 HTTP response (method not allowed).Here is the DEBUG log showing that:
What you expected to happen:
GC tool should use v2 URL prefixes by default.
I suggest that we:
NessieOptions#nessieUri
to be a V2 URI prefix;api/v2
.How to reproduce it (as minimally and precisely as possible):
I think this is happening by default if user uses the default URI, or passes a v1 URI using the
--uri
option.The text was updated successfully, but these errors were encountered: