Add support for the Trino client spooling protocol#496
Conversation
8ac3e6d to
2dc1909
Compare
|
Currently tests are failing because of trinodb/trino#24226 |
2dc1909 to
6ec4713
Compare
6ec4713 to
d7f4ee3
Compare
d7f4ee3 to
6dd0ee6
Compare
|
Can we skip this one failing test for now? |
6dd0ee6 to
f9f2825
Compare
2bf6201 to
992e25c
Compare
wendigo
left a comment
There was a problem hiding this comment.
Overall LGTM except for decoding logic that needs to be improved
| .with_volume_mapping(str(root / "etc/catalog"), "/etc/trino/catalog") | ||
|
|
||
| # Enable spooling config | ||
| if TRINO_VERSION >= "466": |
| HEADER_CLIENT_TAGS = "X-Trino-Client-Tags" | ||
| HEADER_EXTRA_CREDENTIAL = "X-Trino-Extra-Credential" | ||
| HEADER_TIMEZONE = "X-Trino-Time-Zone" | ||
| HEADER_ENCODING = "X-Trino-Query-Data-Encoding" |
There was a problem hiding this comment.
we should document that somewhere @wendigo .. dev guide in trino docs maybe?
992e25c to
5066858
Compare
e01887b to
2a98915
Compare
|
@mdesmet this is a good direction, the only comment I have is that the spooled segment data is resolved eagerly, I think that data fetch should happen in the |
Actually it is not eagerly fetched. with Following section in |
|
LGTM |
2a98915 to
75a9e43
Compare
|
Only remaining issue is making the acknowledge executed in a background thread. |
|
@mdesmet please rebase, how is the async ack going? |
75a9e43 to
6431e2f
Compare
| def acknowledge_request(): | ||
| try: | ||
| http_response = self._send_spooling_request(self.ack_uri, timeout=2) | ||
| if not http_response.ok: | ||
| self._request.raise_response_error(http_response) | ||
| except Exception as e: | ||
| logger.error(f"Failed to acknowledge spooling request for segment {self}: {e}") | ||
| # Start the acknowledgment in a background thread | ||
| thread = threading.Thread(target=acknowledge_request, daemon=True) | ||
| thread.start() |
There was a problem hiding this comment.
@wendigo : apparently I didn't push my latest changes. Here is the async impl.
There was a problem hiding this comment.
I've pushed small fix as the threading will be expensive to use. PTAL
There was a problem hiding this comment.
5e38da4 to
d1b43e4
Compare
|
@mdesmet you can run tests on 467 and drop the last commit |
d1b43e4 to
a75433b
Compare
a75433b to
f55789a
Compare
done |
|
superseded by #509 |
Description
Non-technical explanation
Release notes
( ) This is not user-visible or docs only and no release notes are required.
( ) Release notes are required, please propose a release note for me.
(*) Release notes are required, with the following suggested text:
* Add support for the Trino client spooling protocol