flyrain commented on code in PR #16131:
URL: https://github.com/apache/iceberg/pull/16131#discussion_r3770965101
##########
core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java:
##########
@@ -557,13 +558,22 @@ public Table loadTable(SessionContext context,
TableIdentifier identifier) {
}
List<Credential> credentials = response.credentials();
+ ReadRestrictions readRestrictions = response.readRestrictions();
RESTClient tableClient = client.withAuthSession(tableSession);
Supplier<BaseTable> tableSupplier =
createTableSupplier(
- finalIdentifier, tableMetadata, context, tableClient, tableConf,
credentials);
+ finalIdentifier,
+ tableMetadata,
+ context,
+ tableClient,
+ tableConf,
+ credentials,
+ readRestrictions);
String eTag = responseHeaders.getOrDefault(HttpHeaders.ETAG, null);
- if (eTag != null) {
+ if (eTag != null && readRestrictions.isEmpty()) {
Review Comment:
[P1] This guard only prevents caching the response after restrictions have
been observed. An earlier unrestricted entry is still used to send
`If-None-Match` at the start of `loadTable`; if the server later adds
restrictions without changing table metadata/ETag, it can return 304 and the
method returns the unrestricted cached table before this line is reached.
Please make conditional loading policy-aware (or disable it for this feature)
before the cached ETag is sent, unless the protocol requires ETags to cover
`read-restrictions`.
--
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]