hmangla98 commented on a change in pull request #2529:
URL: https://github.com/apache/hive/pull/2529#discussion_r678751441



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ReplLoadTask.java
##########
@@ -655,17 +679,25 @@ private int executeIncrementalLoad(long loadStartTime) 
throws Exception {
     if (work.replScopeModified) {
       dropTablesExcludedInReplScope(work.currentReplScope);
     }
-    if 
(!MetaStoreUtils.isTargetOfReplication(getHive().getDatabase(work.dbNameToLoadIn)))
 {
+    if (!work.shouldFailover()) {
+      Database targetDb = getHive().getDatabase(work.dbNameToLoadIn);
       Map<String, String> props = new HashMap<>();
-      props.put(ReplConst.TARGET_OF_REPLICATION, "true");
-      AlterDatabaseSetPropertiesDesc setTargetDesc = new 
AlterDatabaseSetPropertiesDesc(work.dbNameToLoadIn, props, null);
-      Task<?> addReplTargetPropTask =
-              TaskFactory.get(new DDLWork(new HashSet<>(), new HashSet<>(), 
setTargetDesc, true,
-                      work.dumpDirectory, work.getMetricCollector()), conf);
-      if (this.childTasks == null) {
-        this.childTasks = new ArrayList<>();
+      if (!MetaStoreUtils.isTargetOfReplication(targetDb)) {
+        props.put(ReplConst.TARGET_OF_REPLICATION, ReplConst.TRUE);
+      }
+      if (ReplUtils.isDbBeingFailedOverAtTarget(targetDb)) {
+        props.put(ReplConst.REPL_FAILOVER_ENABLED, "");

Review comment:
       Yes




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



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

Reply via email to