YuangGao opened a new pull request, #3377:
URL: https://github.com/apache/iceberg-rust/pull/3377

   ## Which issue does this PR close?
   
   - Closes #3340.
   
   ## What changes are included in this PR?
   
   `RestCatalog::load_table` never sent `If-None-Match`, and it parsed a `304` 
as if it were a `200`, so a body-less `304` failed deserialization. This 
follows Java's freshness-aware loading (apache/iceberg#14398):
   
   - Cache tables loaded with an `ETag`, keyed by session id and identifier. A 
later load sends `If-None-Match` and returns the cached table on `304`.
   - Add `rest-table-cache.max-entries` (default 100, 0 disables) and 
`rest-table-cache.expire-after-write-ms` (default 5 minutes), matching Java's 
`RESTCatalogProperties`.
   - Drop the cached entry on drop, purge, rename, a missing `table_exists`, 
and a `404` load.
   - Reject a `304` that answers a load sent without `If-None-Match`.
   
   Like Java, only load responses fill the cache. The reference server derives 
the `ETag` from the request's query parameters too, so a create response's 
`ETag` never matches a later load.
   
   ## Are these changes tested?
   
   - Unit tests with mockito: reuse on `304`, `304` without a cached table, 
replacement on a new `ETag`, invalidation on drop and rename, isolation per 
session, `max-entries=0`, and a rejected zero expiry.
   - Verified against `apache/iceberg-rest-fixture:latest` behind a logging 
proxy: load `200` -> `304`, commit, load `200` with a new `ETag` -> `304`, 
drop, load `404` without `If-None-Match`.
   
   ## AI Disclosure
   - AI-assisted implementation.
   


-- 
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]

Reply via email to