-
Notifications
You must be signed in to change notification settings - Fork 313
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 ES Client to 8.x #1669
Upgrade ES Client to 8.x #1669
Conversation
Also add the elastic-transport library as a dependency.
…lity. As of 8.0.0, transport logic has been moved out of `elasticsearch-py` and into a standalone library, `elastic-transport-python`. This includes substantial changes to the lower-level APIs for configuring client objects. This commit adjusts accordingly, but preserves Rally's previous behavior. This commit also reproduces the product verification behavior of `v7.14.0` of the client: https://github.com/elastic/elasticsearch-py/blob/v7.14.0/elasticsearch/transport.py#L606 As of `v8.0.0`, the client determines whether the server is Elasticsearch by checking whether HTTP responses contain the `X-elastic-product` header. If they do not, it raises an `UnsupportedProductException`. This header was only introduced in Elasticsearch `7.14.0`, however, so the client will consider any version of ES prior to `7.14.0` unsupported due to responses not including it. Because Rally needs to support versions of ES >= 6.8.0, we resurrect this earlier logic for determining the authenticity of the server, which does not rely exclusively on this header.
The client's `transport` object will no longer have a `hosts` attribute, but will had a `node_pool` attribute. Exceptions are also different-- a TransportError will not have a `status_code` attribute, but should contain a status code as its `message`.
The ES client now requires kwargs, so we ensure that we do not use any positional arguments. The client also now distinguishes between a `TransportError` and an `ApiError`, and `ElasticsearchException` has been removed. We adjust accordingly, albeit with a TODO to revisit this.
This migrates to the new `TransportError`/`ApiError` approach, but it's a work in progress and needs another pass before it's considered robust.
This is the new, preferred way of doing this, and these requests fail otherwise. We should genericize this behavior across runners.
Using ssl= is the preferred way since 3.0 (aio-libs/aiohttp#2626) and ssl_context= goes away in the next version, 4.0 (aio-libs/aiohttp#3548).
…ass, and perform verification after the target request
Co-authored-by: Quentin Pradet <[email protected]>
Co-authored-by: Quentin Pradet <[email protected]>
Co-authored-by: Quentin Pradet <[email protected]>
This reverts commit a16450d.
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 really great work @b-deam.
One question/suggestion: Do you think it's worth running a CCS benchmark with this PR? A priori, I don't think there would be any issues there, but instantiating clients for multiple clusters is a code path that isn't otherwise exercised by the testing you've done, so it may be worth a sanity check.
Good suggestion. I tested the CCS challenge locally, but for completeness' sake I ran a comparison using the nightly configuration. The results look OK to me. ccs
I also tested the many-shards-snapshotsbaseline: 6447ae1f-f5d6-438e-835b-90b58bbd403a
|
@elasticmachine run rally/it-python38 |
Great to see this tech debt item fixed as well via this PR/upgrade. |
I doubt that the 20% increase in the how long we wait for the snapshots to complete is due to b9808fc and switching to the native API call We need to keep an eye on the results in https://elasticsearch-benchmarks.elastic.co/#tracks/many-shards-snapshots/nightly/default/90d after merging. Unfortunately we've been hitting some random unexplainable variability lately. |
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.
I gave this another pass and couldn't find anything objectionable. It's been tested thoroughly, so I'm +1 on merging it and keeping an eye on the nightlies after the weekend.
Note for reviewers:
body
parameter in client methods is pervasive across the code base, luckily for us the 8.6 release has an internal decorator that rewrites these params and logs a deprecation warningrequest_timeout
param is now a transport option that must be set via the client's respectiveoptions()
method (e.g.es.options(request_timeout=..).search(..)
). Again, luckily for us the client rewrites this parameter and sets the corresponding transport option and logs a deprecation warningA high level overview of my plan:
esrally race [...]
against:--client-options
TODO
s in thees-client-upgrade
branchelasticsearch[async]
andelastic-transport
libs to8.6.1
and8.4.0
, respectivelybody
parameter to properly typed/named parameters.options()
for transport parameters #1673 to track the refactoring ofrequest-timeout
elastic/logs
is a given, because of its pervasive nature in a lot of our workgeonames
,nyc_taxis
etc.)Closes #1350