[ 
https://issues.apache.org/jira/browse/HIVE-24674?focusedWorklogId=542615&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-542615
 ]

ASF GitHub Bot logged work on HIVE-24674:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 27/Jan/21 03:51
            Start Date: 27/Jan/21 03:51
    Worklog Time Spent: 10m 
      Work Description: 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:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 542615)
    Time Spent: 0.5h  (was: 20m)

> Set repl.source.for property in the db if db is under replication
> -----------------------------------------------------------------
>
>                 Key: HIVE-24674
>                 URL: https://issues.apache.org/jira/browse/HIVE-24674
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Ayush Saxena
>            Assignee: Ayush Saxena
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Add repl.source.for property in the database in case not already set, if the 
> database is under replication.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to