REST: Send If-None-Match on table refresh - #18188
Open
raunaqmorarka wants to merge 1 commit into
Open
raunaqmorarka wants to merge 1 commit into
raunaqmorarka wants to merge 1 commit into
Conversation
Reuse the ETag from loadTable and commit responses so an unchanged table refreshes with a 304 instead of a full metadata body.
raunaqmorarka
force-pushed
the
rest-conditional-refresh
branch
from
September 20, 2026 08:52
9098d9d to
52e3d86
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RESTTableOperations.refresh()always issued an unconditionalGETand parsed the full metadata body, even though the same catalog already does freshness-aware loading forloadTablethroughRESTTableCache. Servers that honourIf-None-Match(for example Polaris) answer with304 Not Modified, so a refresh of an unchanged table only needs a header round trip.RESTTableOperationsnow keeps theETagfrom the load response that created it and from every successful refresh and commit response, sends it asIf-None-Matchonrefresh(), and returnscurrent()on a304without parsing a body. When the server sends noETag, refresh behaves as before. TheRESTTableCacheentry is left untouched, since the ETag there pairs with the metadata captured by the cached supplier.Note:
commit()now uses theRESTClient.postoverload that returns response headers.BaseHTTPClientsupports it; a customRESTClientrelying only on the interface default would need to implement it.Tests cover a conditional refresh returning
304, a changed table still refreshing fully and adopting the newETag, a commitETagbeing reused, servers that send noETag, and the304path over the Jetty-backed test server.