maheshk114 commented on a change in pull request #620: HIVE-21706: REPL Dump 
with concurrent drop of external table fails with InvalidTableException.
URL: https://github.com/apache/hive/pull/620#discussion_r283171277
 
 

 ##########
 File path: ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ReplDumpTask.java
 ##########
 @@ -256,19 +256,25 @@ private Long incrementalDump(Path dumpRoot, DumpMetaData 
dmd, Path cmRoot, Hive
 
       try (Writer writer = new Writer(dumpRoot, conf)) {
         for (String tableName : Utils.matchesTbl(hiveDb, dbName, 
work.tableNameOrPattern)) {
-          Table table = hiveDb.getTable(dbName, tableName);
+          try {
+            Table table = hiveDb.getTable(dbName, tableName);
 
-          // Dump external table locations if required.
-          if (shouldDumpExternalTableLocation() &&
-                  TableType.EXTERNAL_TABLE.equals(table.getTableType())) {
-            writer.dataLocationDump(table);
-          }
+            // Dump external table locations if required.
+            if (shouldDumpExternalTableLocation() &&
+                    TableType.EXTERNAL_TABLE.equals(table.getTableType())) {
+              writer.dataLocationDump(table);
+            }
 
-          // Dump the table to be bootstrapped if required.
-          if (shouldBootstrapDumpTable(table)) {
-            HiveWrapper.Tuple<Table> tableTuple = new HiveWrapper(hiveDb, 
dbName).table(table);
-            dumpTable(dbName, tableName, validTxnList, dbRoot, 
bootDumpBeginReplId, hiveDb,
-                    tableTuple);
+            // Dump the table to be bootstrapped if required.
+            if (shouldBootstrapDumpTable(table)) {
+              HiveWrapper.Tuple<Table> tableTuple = new HiveWrapper(hiveDb, 
dbName).table(table);
+              dumpTable(dbName, tableName, validTxnList, dbRoot, 
bootDumpBeginReplId, hiveDb,
+                      tableTuple);
+            }
+          } catch (InvalidTableException te) {
+            // Repl dump shouldn't fail if the table is dropped/renamed while 
dumping it.
+            // Just log a debug message and skip it.
+            LOG.debug(te.getMessage());
 
 Review comment:
   can be changed to info with table name

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to