Upgrades Elastic search client and urlib3 libraries.#2024
Upgrades Elastic search client and urlib3 libraries.#2024fressi-elastic wants to merge 49 commits intoelastic:masterfrom
urlib3 libraries.#2024Conversation
ee26164 to
1e8aeeb
Compare
1e8aeeb to
1421ad0
Compare
553574d to
de1c485
Compare
…pgrade of elastisearch client libraries.
b9c230c to
46c6f19
Compare
There was a problem hiding this comment.
Pull request overview
This PR upgrades the Elasticsearch client libraries and urllib3 to newer major versions, updating from Elasticsearch 8.x to 9.x and urllib3 1.x to 2.x. The changes include API parameter updates, refactoring of header handling logic, and deprecation of certain track dependencies.
Changes:
- Updated
elasticsearch[async]from 8.6.1 to 9.2.1,elastic-transportfrom 8.4.1 to 9.2.1, andurllib3from 1.26.19 to 2.6.3 - Renamed
maxsizeparameter toconnections_per_nodein client initialization to match the new API - Refactored header handling logic into reusable functions and improved MIME type compatibility handling
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Updated dependency versions for elasticsearch, elastic-transport, urllib3, and pip |
| esrally/client/factory.py | Changed maxsize to connections_per_node parameter |
| tests/client/factory_test.py | Updated test to use connections_per_node parameter |
| esrally/client/common.py | Refactored header combining and MIME type compatibility logic into dedicated functions |
| esrally/client/synchronous.py | Updated to use new header handling functions and added endpoint_id/path_parts parameters |
| esrally/client/asynchronous.py | Updated RallyAsyncElasticsearch signature and header handling to use new functions |
| esrally/track/loader.py | Added deprecation handling for elasticsearch and elastic-transport dependencies in tracks |
| esrally/utils/versions.py | Added type hints to is_version_identifier function |
| it/init.py | Updated test distributions to include 9.2.4 and removed 6.8.0/ARM logic |
| tests/client/common_test.py | Removed test file (likely obsolete after refactoring) |
| tests/driver/runner_test.py | Added typing import and @typing.no_type_check decorator to test |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
urlib3 libraries.
…ocker-compose` (second part).
b1a7027 to
24f6479
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 20 out of 21 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Concerns lifted after internal discussion.
…rform_request methods.
|
@gbanasiak I followed up the suggestion received during past code review interactions and I moved the logic out of |
gbanasiak
left a comment
There was a problem hiding this comment.
Many thanks for simplifications and getting rid of the product checker code! Comments after a more thorough pass below.
| if body is not None: | ||
| # It ensures content-type and accept headers are initialized. | ||
| mimetype = "application/json" | ||
| if path is not None and path.endswith("/_bulk"): | ||
| # Server version 9 is picky about this. This should improve compatibility. | ||
| mimetype = "application/x-ndjson" | ||
| for header in ("content-type", "accept"): | ||
| headers.setdefault(header, mimetype) |
There was a problem hiding this comment.
This seems weird. Why is this required? Is there anything similar in Elasticsearch Python client code? If 9.x version of the client can talk to 9.x version of the server by default, why do we need any extra modifications, e.g. for _bulk?
There was a problem hiding this comment.
Older versions of server where assuming JSON type has to be assumed if not specified when the body was clearly a Json. Newer versions are getting more strict, so we have to provide the headers which the track is not providing to allow posting jsons or bulk objects to the server. Version 9 is more picky than version 8.
There was a problem hiding this comment.
Rally already had this bofore my change for the reason I explained here.
There was a problem hiding this comment.
BulkIndex runner calls Python client's bulk() which sets the right headers, so the above code seems redundant. Does this address a specific failure? In which test, track, operation?
- Update common_test.py for get_compatibility_mode and ensure_mimetype_headers API - Update synchronous_test.py and asynchronous_test.py with perform_request tests - Use monkeypatch and create_autospec; fix type hints and assertions - Client fixes for mypy/pylint Co-authored-by: Cursor <cursoragent@cursor.com>
32d3650 to
92aaaf9
Compare
92aaaf9 to
7a83814
Compare
… error. Refactor test cases.
|
@fressi-elastic I've worked on style and content of EOL policy, see cdc94e9. |
urlib3 libraries.urlib3 libraries.
This PR upgrades the Elasticsearch client libraries and urllib3 to newer major versions, updating from Elasticsearch 8.x to 9.x and urllib3 1.x to 2.x. The changes include API parameter updates, refactoring of header handling logic, and deprecation of certain track dependencies.
Changes:
elasticsearch[async]from 8.6.1 to 9.2.1elastic-transportfrom 8.4.1 to 9.2.1urllib3from 1.26.19 to 2.6.3dockerfrom 6.0.0 to 7.1.0 (due to incompatibility with newer urllib3 releases)maxsizeparameter toconnections_per_nodein client initialization to match the new APIperform_requestmethod.docker-composecommand withdocker composeto avoid conflicts with newurlib3version.it/docker_dev_image_test.pyand update elasticsearch server to version 9.2.4.This PR replaces the now obsolete #2003 and it requires PR elastic/rally-tracks#1000