Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HIVE-21731 : Hive import fails, post upgrade of source 3.0 cluster, to a target 4.0 cluster with strict managed table set to true. #628

Closed
wants to merge 4 commits into from

Conversation

maheshk114
Copy link
Contributor


public void enableAcid() {
hiveConf.setBoolVar(HiveConf.ConfVars.HIVE_SUPPORT_CONCURRENCY, true);
hiveConf.setVar(HiveConf.ConfVars.HIVE_TXN_MANAGER, "org.apache.hadoop.hive.ql.lockmgr.DbTxnManager");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it enough to do this? I think, TxnDbUtil.prepDb should be done, otherwise, it won't work. As the modified test suit is migration case, replica warehouse instance init has initialised it and so it worked. But won't work otherwise.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its working fine for this test ..i could see the table getting converted to acid and bootstrap happening

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is working for this test because, replica warehouse is acid enabled and it initialises the derby DB which is shared by both warehouse instances. But, if both primary and replica are acid disabled, then this won't work if you dynamically change this config.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok ..when ever its required ..it can be done ..currently i don't see any reason to add extra init if its not required

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure. Can we add a comment about this in this method? So that later someone need not wonder why is it not working.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed it from warehouse instance and added to the specific test

@@ -471,7 +473,7 @@ private int executeIncrementalLoad(DriverContext driverContext) {
if (work.hasBootstrapLoadTasks()) {
LOG.debug("Current incremental dump have tables to be bootstrapped. Switching to bootstrap "
+ "mode after applying all events.");
return executeBootStrapLoad(driverContext);
return executeBootStrapLoad(driverContext, true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we set isBootstrapDuringIncLoad in ReplLoadWork object constructor itself? so that need not pass it as extra argument and need not set it after each iteration.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

if (withinContext.hiveConf.getBoolVar(HiveConf.ConfVars.REPL_BOOTSTRAP_ACID_TABLES)) {
if (!AcidUtils.isTransactionalTable(before) && AcidUtils.isTransactionalTable(after)) {
LOG.info("The table " + after.getTableName() + " is converted to ACID table." +
" It will be replicated with bootstrap load as REPL_BOOTSTRAP_ACID_TABLES is set to true.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use hive.repl.bootstrap.acid.tables instead of REPL_BOOTSTRAP_ACID_TABLES.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

// In case user has asked for bootstrap of transactional table, we replace the old one if present. This is to
// make sure that the transactional info like write id etc for the table is consistent between the
// source and target cluster.
if (isBootstrapDuringInc && AcidUtils.isTransactionalTable(table)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, this check should be done even for external tables. Why don't we always replace table in case of isBootstrapDuringInc?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

…o a target 4.0 cluster with strict managed table set to true.
…o a target 4.0 cluster with strict managed table set to true. Review comment fix
@@ -264,6 +264,7 @@ a database ( directory )
|| work.getPathsToCopyIterator().hasNext();

if (addAnotherLoadTask) {
// pass on the bootstrap during incremental flag for next iteration.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need of this comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -471,6 +472,7 @@ private int executeIncrementalLoad(DriverContext driverContext) {
if (work.hasBootstrapLoadTasks()) {
LOG.debug("Current incremental dump have tables to be bootstrapped. Switching to bootstrap "
+ "mode after applying all events.");
work.setBootstrapDuringIncLoad(true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shall set it in ReplLoadWork constructor once for all.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

…o a target 4.0 cluster with strict managed table set to true. Review comment fix - 2
…o a target 4.0 cluster with strict managed table set to true. Review comment fix
@github-actions
Copy link

github-actions bot commented Jun 9, 2020

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Feel free to reach out on the dev@hive.apache.org list if the patch is in need of reviews.

@github-actions github-actions bot added the stale label Jun 9, 2020
@github-actions github-actions bot closed this Jun 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants