pkumarsinha commented on a change in pull request #2092:
URL: https://github.com/apache/hive/pull/2092#discussion_r607283772
##########
File path:
itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenariosAcrossInstances.java
##########
@@ -1558,6 +1569,16 @@ public Boolean apply(NotificationEvent entry) {
.run(" drop database if exists " + replicatedDbName_CM + "
cascade");
}
+ private void compareDbProperties(Map<String, String> primaryDbProps,
Map<String, String> replicaDbProps){
+ for(Map.Entry<String, String> prop : primaryDbProps.entrySet()) {
Review comment:
nit: whitespace after for -> for (Map.Entry<String, String> prop :
primaryDbProps.entrySet()) {
##########
File path:
ql/src/java/org/apache/hadoop/hive/ql/exec/repl/incremental/IncrementalLoadTasksBuilder.java
##########
@@ -163,6 +163,17 @@ public IncrementalLoadTasksBuilder(String dbName, String
loadPath,
taskChainTail.addDependentTask(updateIncPendTask);
taskChainTail = updateIncPendTask;
+ Database dbToLoadIn = hive.getDatabase(dbName);
+ if (!ReplUtils.isTargetOfReplication(dbToLoadIn)) {
+ Map<String, String> props = new HashMap<>();
+ props.put(ReplUtils.TARGET_OF_REPLICATION, "true");
+ AlterDatabaseSetPropertiesDesc setTargetDesc = new
AlterDatabaseSetPropertiesDesc(dbName, props, null);
+ Task<?> addReplTargetPropTask = TaskFactory.get(new DDLWork(inputs,
outputs, setTargetDesc, true,
+ dumpDirectory, metricCollector), conf);
+ taskChainTail.addDependentTask(addReplTargetPropTask);
+ taskChainTail = addReplTargetPropTask;
Review comment:
Shouldn't this be done at the beginning of incremental load and not at
the end. Else, during controlled failover, the events will be loaded first and
then only this property would be set. If there is bootstrap dump attempted on
src, that would pass.
##########
File path:
itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenarios.java
##########
@@ -116,6 +116,7 @@
import static org.apache.hadoop.hive.ql.exec.repl.ReplAck.DUMP_ACKNOWLEDGEMENT;
import static
org.apache.hadoop.hive.ql.exec.repl.ReplAck.NON_RECOVERABLE_MARKER;
import static
org.apache.hadoop.hive.ql.parse.repl.load.DumpMetaData.DUMP_METADATA;
+import static
org.apache.hadoop.hive.ql.exec.repl.util.ReplUtils.TARGET_OF_REPLICATION;
Review comment:
This is unused?
##########
File path:
itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenariosAcrossInstances.java
##########
@@ -1114,13 +1115,18 @@ public void
testIfCkptAndSourceOfReplPropsIgnoredByReplDump() throws Throwable {
.dump(primaryDbName, Collections.emptyList());
// Incremental Repl A -> B with alters on db/table/partition
- WarehouseInstance.Tuple tupleReplicaInc = replica.load(replicatedDbName,
primaryDbName)
- .run("repl status " + replicatedDbName)
+ replica.load(replicatedDbName, primaryDbName);
Review comment:
why not to have a separate test for the above steps?
--
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]