aasha commented on a change in pull request #1897:
URL: https://github.com/apache/hive/pull/1897#discussion_r565006196



##########
File path: 
itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenarios.java
##########
@@ -4086,8 +4086,6 @@ public void testDumpWithPartitionDirMissing() throws 
IOException {
   @Test
   public void testDumpNonReplDatabase() throws IOException {

Review comment:
       can this test itself be removed?

##########
File path: 
ql/src/java/org/apache/hadoop/hive/ql/parse/ReplicationSemanticAnalyzer.java
##########
@@ -177,11 +177,6 @@ private void initReplDump(ASTNode ast) throws 
HiveException {
     for (String dbName : Utils.matchesDb(db, dbNameOrPattern)) {
       Database database = db.getDatabase(dbName);
       if (database != null) {
-        if (!isMetaDataOnly && 
!ReplChangeManager.isSourceOfReplication(database)) {

Review comment:
       Is a check needed on the load side for upgrade scenarios? Say source 
cluster is not upgraded but the target is.

##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ReplDumpTask.java
##########
@@ -873,6 +875,28 @@ Long bootStrapDump(Path dumpRoot, DumpMetaData dmd, Path 
cmRoot, Hive hiveDb)
           throw new HiveException("Replication dump not allowed for replicated 
database" +
                   " with first incremental dump pending : " + dbName);
         }
+
+        if (db != null && !HiveConf.getBoolVar(conf, REPL_DUMP_METADATA_ONLY)) 
{
+          if (!ReplChangeManager.isSourceOfReplication(db)) {
+            // Check if the schedule name is available else set the query value
+            // as default.
+            String value = conf.get(SCHEDULED_QUERY_SCHEDULENAME,
+                "default_" + getQueryState().getQueryString());
+            Map<String, String> params = db.getParameters();
+            if (params != null) {
+              params.put("repl.source.for", value);

Review comment:
       If repl.source.for is already set for a particular db with a policy p1 
and a new policy is created say p2. p2 should be appended to p1.




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