This is an automated email from the ASF dual-hosted git repository.

csringhofer pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git


The following commit(s) were added to refs/heads/master by this push:
     new 0d49c9d6c IMPALA-12929: Skip loading HDFS permissions in local-catalog 
mode
0d49c9d6c is described below

commit 0d49c9d6cc7fc0903d60a78d8aaa996af0249c06
Author: stiga-huang <[email protected]>
AuthorDate: Thu Mar 21 14:37:33 2024 +0800

    IMPALA-12929: Skip loading HDFS permissions in local-catalog mode
    
    HDFS file/dir permissions are not used at all in local catalog mode - in
    LocalFsTable, hasWriteAccessToBaseDir() always returns true and
    getFirstLocationWithoutWriteAccess() always returns null.
    
    However, in catalogd, we still load them (in single thread for a table!)
    which could dominant the table loading time when there are lots of
    partitions. Note that the table loading process in catalogd is the same
    no matter what catalog mode is in used. The difference between catalog
    modes is mainly in how coordinators get metadata from catalogd. Local
    catalog mode is turned on by setting --catalog_topic_mode=minimal on
    catalogd and --use_local_catalog=true on coordinators.
    
    This patch skips loading HDFS permissions on catalogd when running in
    local catalog mode. We can revisit it in IMPALA-7539.
    
    Tests:
     - Ran CORE tests
    
    Change-Id: I5baa9f6ab0d3888a78ff161ae5caa19e85bc983a
    Reviewed-on: http://gerrit.cloudera.org:8080/21178
    Reviewed-by: Impala Public Jenkins <[email protected]>
    Tested-by: Impala Public Jenkins <[email protected]>
---
 fe/src/main/java/org/apache/impala/catalog/HdfsTable.java     | 4 ++++
 fe/src/main/java/org/apache/impala/service/BackendConfig.java | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/fe/src/main/java/org/apache/impala/catalog/HdfsTable.java 
b/fe/src/main/java/org/apache/impala/catalog/HdfsTable.java
index 044a945d8..68491ea62 100644
--- a/fe/src/main/java/org/apache/impala/catalog/HdfsTable.java
+++ b/fe/src/main/java/org/apache/impala/catalog/HdfsTable.java
@@ -877,6 +877,10 @@ public class HdfsTable extends Table implements FeFsTable {
    *              {@link #getAvailableAccessLevel(String, Path, 
FsPermissionCache)}
    */
   private static boolean assumeReadWriteAccess(FileSystem fs) {
+    // Avoid loading permissions in local catalog mode since they are not used 
in
+    // LocalFsTable. Remove this once we resolve IMPALA-7539.
+    if (BackendConfig.INSTANCE.isMinimalTopicMode()) return true;
+
     // Avoid calling getPermissions() on file path for S3 files, as that makes 
a round
     // trip to S3. Also, the S3A connector is currently unable to manage S3 
permissions,
     // so for now it is safe to assume that all files(objects) have READ_WRITE
diff --git a/fe/src/main/java/org/apache/impala/service/BackendConfig.java 
b/fe/src/main/java/org/apache/impala/service/BackendConfig.java
index dae343c8f..ed93a37f8 100644
--- a/fe/src/main/java/org/apache/impala/service/BackendConfig.java
+++ b/fe/src/main/java/org/apache/impala/service/BackendConfig.java
@@ -487,4 +487,8 @@ public class BackendConfig {
   public String queryLogTableName() {
     return backendCfg_.query_log_table_name;
   }
+
+  public boolean isMinimalTopicMode() {
+    return backendCfg_.catalog_topic_mode.equalsIgnoreCase("minimal");
+  }
 }

Reply via email to