pkumarsinha commented on a change in pull request #2101:
URL: https://github.com/apache/hive/pull/2101#discussion_r605391893
##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/ReplTxnTask.java
##########
@@ -106,6 +107,7 @@ public int execute() {
CommitTxnRequest commitTxnRequest = new CommitTxnRequest(txnId);
commitTxnRequest.setReplPolicy(work.getReplPolicy());
commitTxnRequest.setWriteEventInfos(work.getWriteEventInfos());
+ commitTxnRequest.setTxn_type(TxnType.REPL_CREATED);
Review comment:
We don't need this to be set for AbortTxns?
##########
File path: ql/src/java/org/apache/hadoop/hive/ql/lockmgr/DbTxnManager.java
##########
@@ -227,6 +228,12 @@ public long openTxn(Context ctx, String user, TxnType
txnType) throws LockExcept
return openTxn(ctx, user, txnType, 0);
}
+ @Override
+ public long openTxn(Context ctx, String user, TxnType txnType, String
dbUnderReplication) throws LockException {
Review comment:
Can't we re-use replOpenTxn by enhancing that to take txnType?
##########
File path:
standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/AbortTxnRequest.java
##########
@@ -13,17 +13,24 @@
private static final org.apache.thrift.protocol.TField TXNID_FIELD_DESC =
new org.apache.thrift.protocol.TField("txnid",
org.apache.thrift.protocol.TType.I64, (short)1);
private static final org.apache.thrift.protocol.TField
REPL_POLICY_FIELD_DESC = new org.apache.thrift.protocol.TField("replPolicy",
org.apache.thrift.protocol.TType.STRING, (short)2);
+ private static final org.apache.thrift.protocol.TField TXN_TYPE_FIELD_DESC =
new org.apache.thrift.protocol.TField("txn_type",
org.apache.thrift.protocol.TType.I32, (short)3);
Review comment:
you require thrift code generation
##########
File path:
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java
##########
@@ -669,8 +669,10 @@ public OpenTxnsResponse openTxns(OpenTxnRequest rqst)
throws MetaException {
}
List<PreparedStatement> insertPreparedStmts = null;
TxnType txnType = rqst.isSetTxn_type() ? rqst.getTxn_type() :
TxnType.DEFAULT;
+ boolean isReplReplayOperation = rqst.isSetReplPolicy() && txnType ==
TxnType.REPL_CREATED;
+ boolean isReplDumpOrLoadOperation = rqst.isSetReplPolicy() && txnType !=
TxnType.REPL_CREATED;
Review comment:
isReplDumpOrLoadOperation -> isHiveReplTxn ?
##########
File path:
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java
##########
@@ -669,8 +669,10 @@ public OpenTxnsResponse openTxns(OpenTxnRequest rqst)
throws MetaException {
}
List<PreparedStatement> insertPreparedStmts = null;
TxnType txnType = rqst.isSetTxn_type() ? rqst.getTxn_type() :
TxnType.DEFAULT;
+ boolean isReplReplayOperation = rqst.isSetReplPolicy() && txnType ==
TxnType.REPL_CREATED;
Review comment:
isReplayedReplTxn?
when we can have txnType == TxnType.REPL_CREATED but rqst.isSetReplPolicy()
== false?
--
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]