[
https://issues.apache.org/jira/browse/HIVE-25895?focusedWorklogId=720675&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-720675
]
ASF GitHub Bot logged work on HIVE-25895:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 04/Feb/22 06:46
Start Date: 04/Feb/22 06:46
Worklog Time Spent: 10m
Work Description: ayushtkn commented on a change in pull request #2980:
URL: https://github.com/apache/hive/pull/2980#discussion_r799203501
##########
File path:
itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationOptimisedBootstrap.java
##########
@@ -734,4 +743,167 @@ public NotificationEventResponse apply(@Nullable
NotificationEventResponse event
InjectableBehaviourObjectStore.resetGetNextNotificationBehaviour(); //
reset the behaviour
}
}
+
+
+ @Test
+ public void testReverseBootstrap() throws Throwable {
+ List<String> withClause =
ReplicationTestUtils.includeExternalTableClause(true);
+ withClause.add("'" + HiveConf.ConfVars.REPLDIR.varname + "'='" +
primary.repldDir + "'");
+
+ // Do a bootstrap cycle.
+ primary.dump(primaryDbName, withClause);
+ replica.load(replicatedDbName, primaryDbName, withClause);
+
+ // Create 4 managed tables and do a dump & load.
+ WarehouseInstance.Tuple tuple = primary.run("use " + primaryDbName)
+ .run("create table t1 (id int)")
+ .run("insert into table t1 values (1)")
+ .run("insert into table t1 values (2),(3),(4)")
+ .run("create table t2 (place string) partitioned by (country string)")
+ .run("insert into table t2 partition(country='india') values
('chennai')")
+ .run("insert into table t2 partition(country='us') values ('new
york')")
+ .run("create table t3 (id int)")
+ .run("insert into table t3 values (10)")
+ .run("insert into table t3 values (20),(31),(42)")
+ .run("create table t4 (place string) partitioned by (country string)")
+ .run("insert into table t4 partition(country='india') values
('bangalore')")
+ .run("insert into table t4 partition(country='us') values ('austin')")
+ .dump(primaryDbName, withClause);
+
+ // Do the load and check all the external & managed tables are present.
+ replica.load(replicatedDbName, primaryDbName, withClause)
+ .run("repl status " + replicatedDbName)
+ .verifyResult(tuple.lastReplicationId)
+ .run("use " + replicatedDbName)
+ .run("show tables like 't1'")
+ .verifyResult("t1")
+ .run("show tables like 't2'")
+ .verifyResult("t2")
+ .run("show tables like 't3'")
+ .verifyResult("t3")
+ .run("show tables like 't4'")
+ .verifyResult("t4")
+ .verifyReplTargetProperty(replicatedDbName);
+
+
+ // Do some modifications on original source cluster. The diff
becomes(tnew_managed, t1, t2, t3)
+ primary.run("use " + primaryDbName)
+ .run("create table tnew_managed (id int)")
+ .run("insert into table t1 values (25)")
+ .run("insert into table tnew_managed values (110)")
+ .run("insert into table t2 partition(country='france') values
('lyon')")
+ .run("drop table t3");
+
+ // Do some modifications on the target cluster. (t1, t2, t3: bootstrap &
t4, t5: incremental)
+ replica.run("use " + replicatedDbName)
+ .run("insert into table t1 values (101)")
+ .run("insert into table t1 values (210),(321)")
+ .run("insert into table t2 partition(country='india') values
('delhi')")
+ .run("insert into table t3 values (11)")
+ .run("insert into table t4 partition(country='india') values
('lucknow')")
+ .run("create table t5 (place string) partitioned by (country string)")
+ .run("insert into table t5 partition(country='china') values
('beejing')");
+
+ // Prepare for reverse replication.
+ DistributedFileSystem replicaFs = replica.miniDFSCluster.getFileSystem();
+ Path newReplDir = new Path(replica.repldDir + "1");
+ replicaFs.mkdirs(newReplDir);
+ withClause = ReplicationTestUtils.includeExternalTableClause(true);
+ withClause.add("'" + HiveConf.ConfVars.REPLDIR.varname + "'='" +
newReplDir + "'");
Review comment:
Nopes, that isn't. That is there in our doc as well in the initial
assumptions
--
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 720675)
Time Spent: 0.5h (was: 20m)
> Bootstrap tables in table_diff during Incremental Load
> ------------------------------------------------------
>
> Key: HIVE-25895
> URL: https://issues.apache.org/jira/browse/HIVE-25895
> Project: Hive
> Issue Type: Sub-task
> Reporter: Ayush Saxena
> Assignee: Ayush Saxena
> Priority: Major
> Labels: pull-request-available
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> Consume the table_diff_ack file and do a bootstrap dump & load for those
> tables
--
This message was sent by Atlassian Jira
(v8.20.1#820001)