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

SQL CLI requires strict version matching #36186

Open
kcm opened this issue Dec 3, 2018 · 12 comments
Open

SQL CLI requires strict version matching #36186

kcm opened this issue Dec 3, 2018 · 12 comments
Labels
:Analytics/SQL SQL querying Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo)

Comments

@kcm
Copy link
Contributor

kcm commented Dec 3, 2018

". This version of CLI only works with Elasticsearch version " + Version.CURRENT.toString());

Perhaps this could check and indicate against minimumCompatibilityVersion() instead? It might misindicate if the SQL feature isn't properly represented in the logic, but it would be a step better than checking strict version equality.

cc @kurtado

@kcm kcm added >bug :Analytics/SQL SQL querying labels Dec 3, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search

@astefan
Copy link
Contributor

astefan commented Dec 4, 2018

@kcm I don't think this is a bug, as this was the initial intention with this functionality.
Any particular reason why you suggest a minimum compatibility version to be used instead?

@astefan astefan removed the >bug label Dec 4, 2018
@eskibars
Copy link
Contributor

eskibars commented Dec 4, 2018

Agreed that I don't think it's a bug, but it's not particularly user friendly to require strict version matching. I think it's reasonable that a typical user will do things like rolling restart upgrades while leaving older cli utilities around (and expecting them to work).

@costin
Copy link
Member

costin commented Dec 4, 2018

I agree with @eskibars that, at least for CLI, we should be more lenient and not force an upgrade every time the server upgrades as well however how and when we'll get around to do this, remains to be investigating.

Long story - off the top of my head:
For ODBC and JDBC leniency might be nice however it's just safer (especially for diagnostic) purposes to require an upgrade. OTOH some clients might not have the ability to upgrade as easily since the client lifecycle is quite different than that of the server (50 drivers spread across the network/apps vs a server in a centralized place).

A long with the CLI this leads to a versioning strategy similar to that of the server whoever separate from it since it affects only the SQL clients. So the same current/minimum/maximumCompatibilityVersion strategy might work however this needs more thinking before getting around implementing which is a risk for GA.

@nik9000
Copy link
Member

nik9000 commented Dec 4, 2018

With other clients we support forwards compatibility - an older client can talk to a server that is one major version newer. We should probably stick with that everywhere. The advantage of this is that it "fits in" perfectly with how we do versioning on the HTTP API, so long as clients are willing to ignore fields that they don't know.

I suspect we implemented strict version checking in the CLI because we figured we'd break the HTTP API because SQL was so new. If we're sure we're not going to then we can remove that check. Until we're sure, we might want to keep it. Maybe add some note about "because SQL is still beta" or something.

@kcm
Copy link
Contributor Author

kcm commented Dec 4, 2018

@nik9000 that's the gist of my intention, related to how we treat compatibility everywhere. I get the strict checking due to the SQL feature gray area, but then I kind of think it's a bug to wing it in that case. :)

@costin
Copy link
Member

costin commented Dec 4, 2018

@kcm A bug implies incorrect behavior which is not the case; the intent is for all SQL consumers/drivers/clients to have the same version as the server.
The other clients in ES are consumers of a public REST API.
The odbc/jdbc are not; they are drivers that happen to use HTTP and JSON for their own internal protocol. The only guarantee that the drivers make is that they adhere to their respective API implementations.
Most (if not all) ODBC/JDBC drivers that I can think of require the same major version between the driver and the server.
In other words, as it stands, the driver and the server are bound by the serialization protocol.
The CLI is more like a driver as it uses protocol internally for formatting purposes. And such, it will be bound to the server version itself.
Hence why the forward compatibility promise is a big one as it adds a lot of burden and restrictions on the internal SQL protocol.

For example, adding INTERVALs meant adding a new SQL data type that the consumers had to understand. Allowing an old CLI to work with it would kinda work but it would display the data incorrectly (serialized format vs consumable format). Same will happen for geo types when they'll be introduced.

@j-bennet
Copy link

j-bennet commented Apr 9, 2021

I downloaded a snapshot version, and the CLI is not woking, because Elasticsearch version does not match what it expects. Server version is 7.11.0-SNAPSHOT, so the CLI complains:

--- bin/elasticsearch-7.11.0-SNAPSHOT » bin/elasticsearch-sql-cli -v
WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
ERROR: Cannot communicate with the server http://localhost:9200/. This version of CLI only works with Elasticsearch version 7.11.0

@bpintea
Copy link
Contributor

bpintea commented Apr 14, 2021

Cannot communicate with the server http://localhost:9200/

@j-bennet Did u disable the authentication in ES? Since the URI seems otherwise to miss credentials.

@j-bennet
Copy link

@bpintea I did not provide an URI at all, this is the default.
If I provide an URI (with user:password in it), I'm able to log in. So I guess it's user error. It was a very unhelpful error message though:

Cannot communicate with the server http://localhost:9200/. This version of CLI only works with Elasticsearch version 7.11.0

I should have gotten a message about incorrect auth credentials.

@bpintea
Copy link
Contributor

bpintea commented Apr 14, 2021

It was a very unhelpful error message though

That's true, we could probably do better here.

@wchaparro wchaparro removed the Team:QL (Deprecated) Meta label for query languages team label Jan 17, 2024
@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Jan 17, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/SQL SQL querying Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo)
Projects
None yet
Development

No branches or pull requests