-
Notifications
You must be signed in to change notification settings - Fork 4.8k
HIVE-25246: Fix the clean up of open repl created transactions #2396
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
Conversation
...etastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java
Outdated
Show resolved
Hide resolved
ql/src/test/org/apache/hadoop/hive/metastore/txn/TestTxnHandler.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One problem I see is that the txns which are aborted outside replication cycle will lead to a state where when a corresponding commit event come as a part of replication, this will be silently ignored.
ql/src/test/org/apache/hadoop/hive/metastore/txn/TestTxnHandler.java
Outdated
Show resolved
Hide resolved
ql/src/test/org/apache/hadoop/hive/ql/lockmgr/TestDbTxnManager.java
Outdated
Show resolved
Hide resolved
...etastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java
Outdated
Show resolved
Hide resolved
...etastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java
Show resolved
Hide resolved
ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ReplLoadTask.java
Outdated
Show resolved
Hide resolved
...etastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java
Outdated
Show resolved
Hide resolved
...e-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenariosAcidTables.java
Outdated
Show resolved
Hide resolved
long loadTaskStartTime = System.currentTimeMillis(); | ||
SecurityUtils.reloginExpiringKeytabUser(); | ||
//Don't proceed if target db is replication incompatible. | ||
if (work.dbNameToLoadIn != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When would this be null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can have some situation in which work.dbNameToLoadIn is not set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we know when could that be?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have test cases to test REPL LOAD * scenarios.
//Don't proceed if target db is replication incompatible. | ||
if (work.dbNameToLoadIn != null) { | ||
Database targetDb = getHive().getDatabase(work.dbNameToLoadIn); | ||
if (targetDb != null && MetaStoreUtils.isDbReplIncompatible(targetDb)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When would targetDb be null? When a wrong work.dbNameToLoadIn is specified ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for the first load operation (bootstrap load), targetDb would be null.
replica.load("", "`*`"); | ||
} catch (SemanticException e) { | ||
assertEquals("REPL LOAD * is not supported", e.getMessage()); | ||
assertTrue(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will always fail. Why do you need to have such assertion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assertEquals("REPL LOAD * is not supported", e.getMessage()); -
Do we not throw this error anymore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This particular error is outdated. Earlier, repl load did not raise any exception and hence catch clause was of no use. In this change, Repl load will throw an exception stating that dbname can't be null.
Fix the clean up of open repl created transactions