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

Upgrade Elasticsearch client and drop support for unsupported versions #11263

Merged
merged 1 commit into from
Jun 25, 2022

Conversation

hashhar
Copy link
Member

@hashhar hashhar commented Mar 1, 2022

Description

Elasticsearch clients are forward compatible and only guaranteed to work
with servers with matching major versions. i.e. 6.8.23 client would work
with 6.8.x and newer servers only. This also changes the
TestElasticsearch6ConnectorTest to use 6.6.0 version for tests since
that's the oldest version against which the connector passes all tests.

This also adds comments explaining why an exclusion exists and also
removes those that are no longer required - reducing the chances that
someone runs into runtime errors if they do something which we don't
explicitly test.

Documentation

(x) Sufficient documentation is included in this PR.

Release notes

(x) Release notes entries required with the following suggested text:

# Elasticsearch
* Drop support for Elasticsearch servers older than 6.6.0. ({issue}`11263`)

@hashhar hashhar added the WIP label Mar 1, 2022
@cla-bot cla-bot bot added the cla-signed label Mar 1, 2022
@hashhar
Copy link
Member Author

hashhar commented Mar 1, 2022

I've removed all exclusions for now to see what fails and will clean up exclusions as required.

@github-actions github-actions bot added the docs label Mar 1, 2022
@hashhar
Copy link
Member Author

hashhar commented Mar 2, 2022

cc: @martint Somehow it's working without any exclusions applied. Can you share some context on why the exclusions were added and if they may still be needed?

Also I saw that even 6.8 got EOLed last month, so maybe in a few months we'll want to drop 6.8.x support for good as well. I've kept it here for now.

@martint
Copy link
Member

martint commented Mar 3, 2022

Can you share some context on why the exclusions were added and if they may still be needed?

There was a conflict with dependencies brought in by other components. It's possible those are already updated and the conflict no longer exists.

@hashhar
Copy link
Member Author

hashhar commented Mar 3, 2022

I'll check the dependency tree before and after the change. Thanks for sharing context @martint.

Would we want to drop 6.x altogether since it went EOL Feb 2022 or keep 6.8 for some time and then drop sometime in future?

@martint
Copy link
Member

martint commented Mar 3, 2022

Would we want to drop 6.x altogether since it went EOL Feb 2022 or keep 6.8 for some time and then drop sometime in future?

We should poll users to see what version they are running before dropping support for any version.

@hashhar hashhar force-pushed the hashhar/elasticsearch-upgrade branch from 56b4895 to 7ded8f8 Compare March 13, 2022 18:15
@hashhar hashhar marked this pull request as ready for review March 13, 2022 18:25
@hashhar hashhar requested review from ebyhr and martint March 13, 2022 18:25
@hashhar hashhar force-pushed the hashhar/elasticsearch-upgrade branch 3 times, most recently from 3e7a113 to d2a23e4 Compare March 13, 2022 19:56
@hashhar hashhar force-pushed the hashhar/elasticsearch-upgrade branch from d2a23e4 to e4ca92c Compare March 26, 2022 17:51
@hashhar hashhar force-pushed the hashhar/elasticsearch-upgrade branch from e4ca92c to 63e2233 Compare April 6, 2022 20:59
@hashhar hashhar requested a review from phd3 April 6, 2022 20:59
@hashhar hashhar requested a review from bitsondatadev April 8, 2022 10:15
@phd3
Copy link
Member

phd3 commented Apr 8, 2022

This also changes the
TestElasticsearch6ConnectorTest to use 6.6.0 version for tests since
that’s the oldest version against which the connector passes all tests.

which tests are we talking about here? is this for a new pr?

@hashhar
Copy link
Member Author

hashhar commented Apr 8, 2022

The "tests" there refers to all tests in the trino-elasticsearch module. The client version is being bumped because of some CVEs and because 6.x has been unsupported for some time now - 6.8.23 is the last 6.x version.

Copy link
Member

@phd3 phd3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good % #11263 (comment) taken care of

@findepi findepi marked this pull request as draft April 27, 2022 12:42
@findepi findepi removed the WIP label Apr 27, 2022
@hashhar hashhar force-pushed the hashhar/elasticsearch-upgrade branch from 63e2233 to 966e3ba Compare June 23, 2022 10:42
@hashhar hashhar marked this pull request as ready for review June 23, 2022 10:42
@hashhar
Copy link
Member Author

hashhar commented Jun 23, 2022

We should poll users to see what version they are running before dropping support for any version.

See https://trinodb.slack.com/archives/CFLB9AMBN/p1655477455137409, https://trinodb.slack.com/archives/CP1MUNEUX/p1655450446249759

@martint @phd3 Please take a look, addressed comments.

FYI @bitsondatadev @mosabua

Copy link
Member

@phd3 phd3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! may be add a one-liner in commit description on why we're bumping client version.

The newer version addresses some critical CVEs and fixes some bugs
regarding retry of failed requests being routed to dead hosts. It also
makes the client work with ES 6.7 which had a breaking change causing
older clients to not work with it in some cases.

Elasticsearch clients are forward compatible and only guaranteed to work
with servers with matching major versions. i.e. 6.8.23 client would work
with 6.8.x and newer servers only. This also changes the
TestElasticsearch6ConnectorTest to use 6.6.0 version for tests since
that's the oldest version against which the connector passes all tests.

This also adds comments explaining why an exclusion exists and also
removes those that are no longer required - reducing the chances that
someone runs into runtime errors if they do something which we don't
explicitly test.

Two new explicit dependencies on org.elasticsearch:elasticsearch-core
and org.elasticsearch:elasticsearch-x-content are added because some
classes from org.elasticsearch.common package were moved into separate
modules.
@hashhar hashhar force-pushed the hashhar/elasticsearch-upgrade branch from 966e3ba to 4335822 Compare June 24, 2022 08:33
@hashhar
Copy link
Member Author

hashhar commented Jun 24, 2022

Amended just the commit message - PTAL @phd3.

@hashhar hashhar merged commit 937fe89 into trinodb:master Jun 25, 2022
@hashhar hashhar deleted the hashhar/elasticsearch-upgrade branch June 25, 2022 16:51
@github-actions github-actions bot added this to the 388 milestone Jun 25, 2022
@mosabua
Copy link
Member

mosabua commented Jun 26, 2022

We should definitely add this in the release notes and @colebow and myself can also mention it in the Trino Community Broadcast

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

5 participants