Skip to content

Do not retry spooling-related GET requests with status code 200 and empty body - #640

Closed
azawlocki-sbdt wants to merge 1 commit into
trinodb:masterfrom
azawlocki-sbdt:azawlocki/fix-performance-regression-for-spooling-requests
Closed

azawlocki-sbdt wants to merge 1 commit into
trinodb:masterfrom
azawlocki-sbdt:azawlocki/fix-performance-regression-for-spooling-requests

Conversation

@azawlocki-sbdt

@azawlocki-sbdt azawlocki-sbdt commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Description

Since #603, the client treats all GET requests to which the server responds with status code 200 and empty body as failed and retries them. But the empty body is a normal response for segment acknowledgements requests, they should not be retried if the status is 200.

This PR fixes that by turning off body emptiness checking (effectively reverting PR #603) for spooling-releted requests. For simplicity, emptiness checking is turned off for spooling data requests, as well as spooling
acknowledgement requests.

Additional minor change is to access content rather than text when checking for emptiness, to avoid decoding binary responses to text just to see if they are not empty.

Non-technical explanation

A fix for the bug that resulted in retrying successful segment acknowledgement requests, leading to performance degradation when downloading a large number of segments.

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:

* Fix some things. ({issue}`issuenumber`)

@cla-bot cla-bot Bot added the cla-signed label Sep 22, 2026
@azawlocki-sbdt
azawlocki-sbdt force-pushed the azawlocki/fix-performance-regression-for-spooling-requests branch from cb823d8 to 4445404 Compare September 22, 2026 12:49
The client currently treats all GET requests to which Trino responds
with status code 200 and empty body as failed and retries them.
But the empty body is a normal response for segment acknowledgements
requests, they should not be retried if the status is 200.

This change fixes that by turning off body emptiness checking
(effectively reverting PR trinodb#603) for spooling-releted requests.

Additional minor change is to access `content` rather than `text`
when checking for emptiness, to avoid decoding binary responses
to text just to see if they are not empty.
@azawlocki-sbdt
azawlocki-sbdt force-pushed the azawlocki/fix-performance-regression-for-spooling-requests branch from 4445404 to 0fcca9e Compare September 22, 2026 12:50
@lozbrown

Copy link
Copy Markdown
Contributor

Isn't this a duplicate fix if this #637

@azawlocki-sbdt

Copy link
Copy Markdown
Contributor Author

Isn't this a duplicate fix if this #637

Yes, it is! I wasn't aware of #637, thanks @lozbrown. Closing the current PR in favor of #637 which has wider scope (rightfully) and better description.

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.

2 participants