sankarh commented on a change in pull request #679: HIVE-21764 : REPL DUMP 
should detect and bootstrap any rename table events where old table was 
excluded but renamed table is included.
URL: https://github.com/apache/hive/pull/679#discussion_r296212406
 
 

 ##########
 File path: 
ql/src/java/org/apache/hadoop/hive/ql/parse/repl/dump/events/AlterTableHandler.java
 ##########
 @@ -82,14 +92,71 @@ private Scenario 
scenarioType(org.apache.hadoop.hive.metastore.api.Table before,
     }
   }
 
+  // return true, if event needs to be dumped, else return false.
+  private boolean handleForTableLevelReplication(Context withinContext) {
+    String oldName = before.getTableName();
+    String newName = after.getTableName();
+
+    if (ReplUtils.tableIncludedInReplScope(withinContext.replScope, oldName)) {
+      // If the table is renamed after being added to the list of tables to be 
bootstrapped, then remove it from the
+      // list of tables to be bootstrapped.
+      boolean oldTableIsPresent = 
withinContext.removeFromListOfTablesForBootstrap(before.getTableName());
 
 Review comment:
   Let's say, a non-acid table is converted to external. Now, since, both names 
match ReplScope, this event is dumped. Now, all the other events on this alter 
table would be skipped as BOOTSTRAP_EXTERNAL config is true. Now, we replicate 
the event and also, bootstrap the table which may fail. This is not related to 
this patch but still want to check if it can happen. I noticed, we block change 
table type only if STRICT_MANAGED=true.

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