morningman commented on code in PR #11793:
URL: https://github.com/apache/doris/pull/11793#discussion_r972025371


##########
fs_brokers/apache_hdfs_broker/src/main/java/org/apache/doris/broker/hdfs/FileSystemManager.java:
##########
@@ -849,23 +847,43 @@ private int readBytesFully(FSDataInputStream is, byte[] 
dest) throws IOException
         return readLength;
     }
 
-    private BrokerFileSystem updateCachedFileSystem(FileSystemIdentity 
fileSystemIdentity) {
-        BrokerFileSystem brokerFileSystem = null;
+    /**
+     *   In view of the different expiration mechanisms of different 
authentication modes,
+     *   there are two ways to determine whether BrokerFileSystem has expired:
+     *   1. For the authentication mode of Kerberos and S3 aksk, use the 
createTime to determine whether it expires
+     *   2. For other authentication modes, the lastAccessTime is used to 
determine whether it has expired
+     */
+    private BrokerFileSystem updateCachedFileSystem(FileSystemIdentity 
fileSystemIdentity, Map<String, String> properties) {
+        BrokerFileSystem brokerFileSystem;
         if (cachedFileSystem.containsKey(fileSystemIdentity)) {
             brokerFileSystem = cachedFileSystem.get(fileSystemIdentity);
-            if 
(brokerFileSystem.isExpired(BrokerConfig.client_expire_seconds)) {
-                logger.info("file system " + brokerFileSystem + " is expired, 
close and remove it");
+            if ((properties.containsKey(KERBEROS_KEYTAB) && 
properties.containsKey(KERBEROS_PRINCIPAL))
+                || (properties.containsKey(FS_KS3_ACCESS_KEY) && 
properties.containsKey(FS_KS3_SECRET_KEY))
+                || (properties.containsKey(FS_S3A_ACCESS_KEY) && 
properties.containsKey(FS_S3A_SECRET_KEY))) {
+                if 
(brokerFileSystem.isExpiredByCreateTime(BrokerConfig.client_expire_seconds)) {
+                    logger.info("file system " + brokerFileSystem + " is 
expired, update it.");
+                    try {
+                        Configuration conf = new HdfsConfiguration();

Review Comment:
   Only do this for kerberos



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to