Savonitar commented on code in PR #30039:
URL: https://github.com/apache/flink/pull/30039#discussion_r4724075012


##########
flink-filesystems/flink-gs-fs-hadoop/src/main/java/org/apache/flink/fs/gs/utils/ConfigUtils.java:
##########
@@ -149,6 +159,15 @@ public static Optional<GoogleCredentials> 
getStorageCredentials(
             LOGGER.info(
                     "Creating GSRecoverableWriter using credentials from {}",
                     credentialsPath.get());
+            if (!isConnectorAuthTypeSet(hadoopConfig)) {

Review Comment:
   Does it make sense to preserve the previous credential selection when 
`gs.auth.type` is unset? 
   
   `matchingAuthType` is already known here, so we could default 
`fs.gs.auth.type` to it instead of only warning. WDYT?



##########
flink-filesystems/flink-gs-fs-hadoop/src/test/java/org/apache/flink/fs/gs/utils/ConfigUtilsAuthTypeTest.java:
##########
@@ -0,0 +1,214 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.fs.gs.utils;
+
+import org.apache.flink.configuration.Configuration;
+import org.apache.flink.fs.gs.TestUtils;
+import org.apache.flink.testutils.logging.LoggerAuditingExtension;
+
+import com.google.auth.oauth2.GoogleCredentials;
+import com.google.cloud.hadoop.fs.gcs.GoogleHadoopFileSystemConfiguration;
+import com.google.cloud.hadoop.util.HadoopCredentialsConfiguration;
+import 
com.google.cloud.hadoop.util.HadoopCredentialsConfiguration.AuthenticationType;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.slf4j.event.Level;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+/**
+ * Tests that the two documented credential setups give gcs-connector and the 
RecoverableWriter the
+ * same credentials, and that Flink warns when they don't.
+ */
+class ConfigUtilsAuthTypeTest {
+
+    private static final String CONF_DIR = "/hadoop/conf";
+
+    private static final String APPLICATION_CREDENTIALS = 
"/opt/application.json";
+
+    private static final String KEYFILE = "/opt/keyfile.json";
+
+    @RegisterExtension
+    private final LoggerAuditingExtension warnings =
+            new LoggerAuditingExtension(ConfigUtils.class, Level.WARN);
+
+    @Test
+    void warnsForApplicationCredentialsWithoutAuthType() {
+        final org.apache.hadoop.conf.Configuration hadoopConfig =
+                loadCredentials(
+                        Collections.emptyMap(),
+                        Collections.emptyMap(),
+                        APPLICATION_CREDENTIALS,
+                        APPLICATION_CREDENTIALS);
+
+        assertThat(hadoopConfig.get("fs.gs.auth.type")).isNull();
+        
assertThat(connectorAuthType(hadoopConfig)).isEqualTo(AuthenticationType.COMPUTE_ENGINE);

Review Comment:
   Is this change in authentication behavior intentional? 
   Lets say we have a Flink cluster on AWS that checkpoints to GCS using only 
`GOOGLE_APPLICATION_CREDENTIALS` (as our previous docs recommended). With 
2.2.18 the Hadoop connector used that file. 
   This test now expects it to select `COMPUTE_ENGINE`. But that cluster has no 
Google metadata server, so upgrading the plugin alone can cause its checkpoints 
to fail.



##########
flink-filesystems/flink-gs-fs-hadoop/pom.xml:
##########
@@ -34,11 +34,11 @@ under the License.
        <properties>
                <!-- If updating these dependency versions, please also update 
the corresponding links -->
                <!-- in the GCS file system documentation. -->
-               <fs.gs.sdk.version>2.68.0</fs.gs.sdk.version>
-               
<fs.gs.connector.version>hadoop3-2.2.18</fs.gs.connector.version>
-               <fs.gs.cloud.nio.version>0.128.7</fs.gs.cloud.nio.version>
+               <fs.gs.sdk.version>2.79.0</fs.gs.sdk.version>
+               <fs.gs.connector.version>3.1.22</fs.gs.connector.version>

Review Comment:
   should we use 3.1.23? It was released on Nov 20, I see PR mentions that 
3.1.22 is the last version (so I assume the intention was to use the latest 
version).



##########
flink-filesystems/flink-gs-fs-hadoop/src/main/java/org/apache/flink/fs/gs/utils/ConfigUtils.java:
##########


Review Comment:
   > // 4) use no credentials
   
   the docs now say that the RecoverableWriter falls back to application 
default credentials. should we change this comment?



##########
flink-filesystems/flink-gs-fs-hadoop/src/main/resources/META-INF/NOTICE:
##########
@@ -11,104 +11,113 @@ This project bundles the following dependencies under the 
Apache Software Licens
 - com.fasterxml.jackson.core:jackson-databind:2.22.2
 - com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.22.2
 - com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.22.2
-- com.fasterxml.woodstox:woodstox-core:7.0.0
+- com.fasterxml.woodstox:woodstox-core:7.2.0
 - com.google.android:annotations:4.1.1.4
-- com.google.api-client:google-api-client-jackson2:2.0.1
-- com.google.api-client:google-api-client:2.7.2
-- com.google.api.grpc:gapic-google-cloud-storage-v2:2.68.0
-- com.google.api.grpc:grpc-google-cloud-storage-v2:2.68.0
+- com.google.api-client:google-api-client-gson:2.9.2
+- com.google.api-client:google-api-client:2.9.2
+- com.google.api.grpc:gapic-google-cloud-storage-v2:2.79.0
+- com.google.api.grpc:grpc-google-cloud-storage-control-v2:2.49.0
+- com.google.api.grpc:grpc-google-cloud-storage-v2:2.79.0
+- com.google.api.grpc:proto-google-cloud-logging-v2:0.110.4
 - com.google.api.grpc:proto-google-cloud-monitoring-v3:3.52.0
-- com.google.api.grpc:proto-google-cloud-storage-v2:2.68.0
-- com.google.api.grpc:proto-google-common-protos:2.71.0
-- com.google.api.grpc:proto-google-iam-v1:1.66.0
+- com.google.api.grpc:proto-google-cloud-storage-control-v2:2.49.0
+- com.google.api.grpc:proto-google-cloud-storage-v2:2.79.0
+- com.google.api.grpc:proto-google-common-protos:2.82.0
+- com.google.api.grpc:proto-google-iam-v1:1.77.0
 - com.google.apis:google-api-services-iamcredentials:v1-rev20211203-2.0.0
-- com.google.apis:google-api-services-storage:v1-rev20260204-2.0.0
+- com.google.apis:google-api-services-storage:v1-rev20260524-2.0.0
 - com.google.auto.value:auto-value-annotations:1.11.0
-- com.google.cloud.bigdataoss:gcs-connector:hadoop3-2.2.18
-- com.google.cloud.bigdataoss:gcsio:2.2.18
-- com.google.cloud.bigdataoss:util-hadoop:hadoop3-2.2.18
-- com.google.cloud.bigdataoss:util:2.2.18
-- com.google.cloud.opentelemetry:detector-resources-support:0.33.0
+- com.google.cloud.bigdataoss:gcs-connector:3.1.22
+- com.google.cloud.bigdataoss:gcsio:3.1.22
+- com.google.cloud.bigdataoss:util-hadoop:3.1.22
+- com.google.cloud.bigdataoss:util:3.1.22
+- com.google.cloud.opentelemetry:detector-resources-support:0.31.0
 - com.google.cloud.opentelemetry:exporter-metrics:0.33.0
 - com.google.cloud.opentelemetry:shared-resourcemapping:0.33.0
-- com.google.cloud:google-cloud-core-grpc:2.70.0
-- com.google.cloud:google-cloud-core-http:2.70.0
-- com.google.cloud:google-cloud-core:2.70.0
+- com.google.cloud:google-cloud-core-grpc:2.81.0
+- com.google.cloud:google-cloud-core-http:2.81.0
+- com.google.cloud:google-cloud-core:2.81.0
+- com.google.cloud:google-cloud-logging:3.21.4
 - com.google.cloud:google-cloud-monitoring:3.52.0
-- com.google.cloud:google-cloud-storage:2.68.0
-- com.google.code.gson:gson:2.13.2
-- com.google.flogger:flogger-system-backend:0.7.1
-- com.google.flogger:flogger:0.7.1
-- com.google.flogger:google-extensions:0.7.1
+- com.google.cloud:google-cloud-storage-control:2.49.0

Review Comment:
   > com.google.cloud:google-cloud-storage-control:2.49.0
   
   and 
   
   > com.google.cloud:google-cloud-storage:2.79.0
   
   have gap in minor versions. is it intentional? 



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

Reply via email to