ArkoSharma commented on a change in pull request #1898:
URL: https://github.com/apache/hive/pull/1898#discussion_r563496522



##########
File path: 
ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ReplExternalTables.java
##########
@@ -183,6 +184,22 @@ private void dirLocationToCopy(FileList fileList, Path 
sourcePath, HiveConf conf
             throws HiveException {
       Path basePath = getExternalTableBaseDir(conf);
       Path targetPath = externalTableDataPath(conf, basePath, sourcePath);
+      //Here, when src and target are HA clusters with same NS, then 
sourcePath would have the correct host
+      //whereas the targetPath would have an host that refers to the target 
cluster. This is fine for
+      //data-copy running during dump as the correct logical locations would 
be used. But if data-copy runs during
+      //load, then the remote location needs to point to the src cluster from 
where the data would be copied and
+      //the common original NS would suffice for targetPath.
+      
if(hiveConf.getBoolVar(HiveConf.ConfVars.REPL_HA_DATAPATH_REPLACE_REMOTE_NAMESERVICE)
 &&
+              
hiveConf.getBoolVar(HiveConf.ConfVars.REPL_RUN_DATA_COPY_TASKS_ON_TARGET)) {
+        String remoteNS = 
hiveConf.get(HiveConf.ConfVars.REPL_HA_DATAPATH_REPLACE_REMOTE_NAMESERVICE_NAME.varname);
+        if (StringUtils.isEmpty(remoteNS)) {
+          throw new SemanticException(ErrorMsg.REPL_INVALID_CONFIG_FOR_SERVICE

Review comment:
       Yes, it is a non recoverable error if the remote NS config is not 
specified.There needs to be a valid remote NS name and the same name should be 
used in both the dump and load commands. 
   
   The same exception is being thrown for managed tables.




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



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

Reply via email to