ashutosh-bapat commented on a change in pull request #551: HIVE-21286: Hive should support clean-up of previously bootstrapped tables when retry from different dump. URL: https://github.com/apache/hive/pull/551#discussion_r262800301
########## File path: itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenariosExternalTables.java ########## @@ -573,23 +577,32 @@ public void retryBootstrapExternalTablesFromDifferentDump() throws Throwable { .run("create table t5 as select * from t4") .dump(primaryDbName, tupleBootstrapWithoutExternal.lastReplicationId, dumpWithClause); - // Verify if bootstrapping with same dump is idempotent and return same result - for (int i = 0; i < 2; i++) { - replica.load(replicatedDbName, tupleIncWithExternalBootstrap.dumpLocation, loadWithClause) - .status(replicatedDbName) - .verifyResult(tupleIncWithExternalBootstrap.lastReplicationId) - .run("use " + replicatedDbName) - .run("show tables like 't1'") - .verifyFailure(new String[]{"t1"}) - .run("select place from t2 where country = 'us'") - .verifyResult("austin") - .run("select id from t4") - .verifyResult("10") - .run("select id from t5") - .verifyResult("10"); + // Fail setting ckpt property for table t4 but success for t2. + BehaviourInjection<CallerArguments, Boolean> callerVerifier + = new BehaviourInjection<CallerArguments, Boolean>() { + @Nullable + @Override + public Boolean apply(@Nullable CallerArguments args) { + if (args.tblName.equalsIgnoreCase("t4") && args.dbName.equalsIgnoreCase(replicatedDbName)) { + injectionPathCalled = true; + LOG.warn("Verifier - DB : " + args.dbName + " TABLE : " + args.tblName); + return false; + } + return true; + } + }; + + // Fail repl load before the ckpt property is set for t4 and after it is set for t2. + // In the retry, these half baked tables should be dropped and bootstrap should ve successful. Review comment: "should ve" - typo, should be "should be" ---------------------------------------------------------------- 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 With regards, Apache Git Services