You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by vg...@apache.org on 2020/10/02 16:12:38 UTC

[hive] branch master updated: HIVE-24210: PartitionManagementTask fails if one of tables dropped after fetching TableMeta (Naresh P R, reviewed by Vineet Garg)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new d4de3a7  HIVE-24210: PartitionManagementTask fails if one of tables dropped after fetching TableMeta (Naresh P R, reviewed by Vineet Garg)
d4de3a7 is described below

commit d4de3a75da2be1e42f63ebc4cfd315614b30ddfa
Author: Naresh P R <pr...@gmail.com>
AuthorDate: Fri Oct 2 09:12:19 2020 -0700

    HIVE-24210: PartitionManagementTask fails if one of tables dropped after fetching TableMeta (Naresh P R, reviewed by Vineet Garg)
---
 .../hadoop/hive/metastore/PartitionManagementTask.java       | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/PartitionManagementTask.java b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/PartitionManagementTask.java
index 612ac87..d30b41d 100644
--- a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/PartitionManagementTask.java
+++ b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/PartitionManagementTask.java
@@ -32,6 +32,7 @@ import java.util.concurrent.locks.ReentrantLock;
 
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hive.common.repl.ReplConst;
+import org.apache.hadoop.hive.metastore.api.NoSuchObjectException;
 import org.apache.hadoop.hive.metastore.api.Table;
 import org.apache.hadoop.hive.metastore.api.TableMeta;
 import org.apache.hadoop.hive.metastore.conf.MetastoreConf;
@@ -127,9 +128,14 @@ public class PartitionManagementTask implements MetastoreTaskThread {
           dbPattern, tablePattern, foundTableMetas.size());
 
         for (TableMeta tableMeta : foundTableMetas) {
-          Table table = msc.getTable(tableMeta.getCatName(), tableMeta.getDbName(), tableMeta.getTableName());
-          if (partitionDiscoveryEnabled(table.getParameters()) && !tblBeingReplicatedInto(table.getParameters())) {
-            candidateTables.add(table);
+          try {
+            Table table = msc.getTable(tableMeta.getCatName(), tableMeta.getDbName(), tableMeta.getTableName());
+            if (partitionDiscoveryEnabled(table.getParameters()) && !tblBeingReplicatedInto(table.getParameters())) {
+              candidateTables.add(table);
+            }
+          } catch (NoSuchObjectException e) {
+            // Ignore dropped tables after fetching TableMeta.
+            LOG.warn(e.getMessage());
           }
         }
         if (candidateTables.isEmpty()) {