raunaqmorarka opened a new pull request, #18188: URL: https://github.com/apache/iceberg/pull/18188
`RESTTableOperations.refresh()` always issued an unconditional `GET` and parsed the full metadata body, even though the same catalog already does freshness-aware loading for `loadTable` through `RESTTableCache`. Servers that honour `If-None-Match` (for example Polaris) answer with `304 Not Modified`, so a refresh of an unchanged table only needs a header round trip. `RESTTableOperations` now keeps the `ETag` from the load response that created it and from every successful refresh and commit response, sends it as `If-None-Match` on `refresh()`, and returns `current()` on a `304` without parsing a body. When the server sends no `ETag`, refresh behaves as before. The `RESTTableCache` entry is left untouched, since the ETag there pairs with the metadata captured by the cached supplier. Note: `commit()` now uses the `RESTClient.post` overload that returns response headers. `BaseHTTPClient` supports it; a custom `RESTClient` relying 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 new `ETag`, a commit `ETag` being reused, servers that send no `ETag`, and the `304` path over the Jetty-backed test server. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
