amdubovoi commented on code in PR #18716:
URL: https://github.com/apache/iceberg/pull/18716#discussion_r4811223036


##########
gcp/src/main/java/org/apache/iceberg/gcp/gcs/OAuth2RefreshCredentialsHandler.java:
##########
@@ -46,11 +47,12 @@ public class OAuth2RefreshCredentialsHandler
   private final String credentialsEndpoint;
   // will be used to refresh the OAuth2 token
   private final String catalogEndpoint;
+  private final String storagePrefix;

Review Comment:
   I am not sure that this belongs in this PR. One refresh per table is 
probably the right direction, and it would also avoid a catalog session for 
each client. But it adds a shared cache with its own locking and rules for when 
to call the endpoint again. It also needs a merge with the scheduled refresh in 
GCSFileIO. That changes the scope and the purpose of this PR
   
   In my tests, Polaris, Lakekeeper, Gravitino and Unity Catalog send one GCS 
credential, and they behave as before. Nessie sends one for each location, and 
its refresh fails today, so this PR fixes a failure and does not add a 
regression
   
   S3 and ADLS have the same per-client refresh, and #18757 fixes them in the 
same way. I prefer to do a shared refresh for all three in a follow-up PR when 
18757 lands as well. What do you think?



##########
gcp/src/main/java/org/apache/iceberg/gcp/gcs/PrefixedStorage.java:
##########
@@ -152,7 +152,8 @@ private Credentials credentials(GCPProperties properties) {
     // in most cases the convenient way, especially in GCP.
     // See javadoc of 
com.google.auth.oauth2.GoogleCredentials.getApplicationDefault()
     if (properties.oauth2Token().isPresent()) {
-      return GCPAuthUtils.oauth2CredentialsFromGcpProperties(properties, 
closeableGroup);
+      return GCPAuthUtils.oauth2CredentialsFromGcpProperties(
+          properties, storagePrefix, closeableGroup);

Review Comment:
   Fixed



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