You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by sa...@apache.org on 2016/02/11 20:18:57 UTC
[1/2] incubator-trafodion git commit: TRAFODION-1798 This change is
item 2( of 4 items ). Fixes a hang situation when inserts and drop on the
same table happens in the same transaction.
Repository: incubator-trafodion
Updated Branches:
refs/heads/master e9d21463f -> 8c5cce859
TRAFODION-1798 This change is item 2( of 4 items ). Fixes a hang
situation when inserts and drop on the same table happens in the
same transaction.
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/7c7f145e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/7c7f145e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/7c7f145e
Branch: refs/heads/master
Commit: 7c7f145e4cbd1c7db7836d1cc720dca03a345fd5
Parents: 8c955e6
Author: Prashant Vasudev <pr...@esgyn.com>
Authored: Wed Feb 10 18:52:33 2016 +0000
Committer: Prashant Vasudev <pr...@esgyn.com>
Committed: Wed Feb 10 18:52:33 2016 +0000
----------------------------------------------------------------------
.../transactional/TransactionManager.java | 50 ++++++++++++++++++--
1 file changed, 47 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/7c7f145e/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TransactionManager.java
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TransactionManager.java b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TransactionManager.java
index 220d4ac..5b52aef 100644
--- a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TransactionManager.java
+++ b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/client/transactional/TransactionManager.java
@@ -328,10 +328,54 @@ public class TransactionManager {
throw new Exception(msg);
}
if(result.size() == 0) {
- LOG.error("doCommitX, received incorrect result size: " + result.size() + " txid: "
- + transactionId + " location: " + location.getRegionInfo().getRegionNameAsString());
+ if(LOG.isTraceEnabled()) LOG.trace("doCommitX,received incorrect result size: " + result.size() + " txid: "
+ + transactionId + " location: " + location.getRegionInfo().getRegionNameAsString());
+
refresh = true;
retry = true;
+ //if transaction for DDL operation, it is possible this table is disabled
+ //as part of prepare if the table was intended for a drop. If this is the case
+ //this exception can be ignored.
+ if(transactionState.hasDDLTx())
+ {
+ if(LOG.isTraceEnabled()) LOG.trace("doCommitX, checking against DDL Drop list: result size: " +
+ result.size() + " txid: " + transactionId + " location: " + location.getRegionInfo().getRegionNameAsString() +
+ "table: " + table.getName().getNameAsString());
+
+ ArrayList<String> createList = new ArrayList<String>(); //This list is ignored.
+ ArrayList<String> dropList = new ArrayList<String>();
+ ArrayList<String> truncateList = new ArrayList<String>();
+ StringBuilder state = new StringBuilder ();
+ try {
+ tmDDL.getRow(transactionState.getTransactionId(), state, createList, dropList, truncateList);
+ }
+ catch(Exception e){
+ LOG.error("doCommitX, exception in tmDDL getRow: " + e);
+ if(LOG.isTraceEnabled()) LOG.trace("doCommitX, exception in tmDDL getRow:: txID: " + transactionState.getTransactionId());
+ state.append("INVALID"); //to avoid processing further down this path.
+ }
+
+ if(state.toString().equals("VALID") && dropList.size() > 0)
+ {
+ Iterator<String> di = dropList.iterator();
+ while (di.hasNext())
+ {
+ if(table.getName().getNameAsString().equals(di.next().toString()))
+ {
+ retry = false; //match found
+ refresh = false;//match found
+ if(LOG.isTraceEnabled()) LOG.trace("doCommitX, found table in DDL Drop list, this is expected exception. result size: " +
+ result.size() + " txid: " + transactionId + " location: " + location.getRegionInfo().getRegionNameAsString() +
+ "table: " + table.getName().getNameAsString());
+ }
+ }
+ }
+ }
+ else
+ {
+ LOG.error("doCommitX, received incorrect result size: " + result.size() + " txid: "
+ + transactionId + " location: " + location.getRegionInfo().getRegionNameAsString());
+ }
}
else if(result.size() == 1){
// size is 1
@@ -2937,7 +2981,7 @@ public class TransactionManager {
}
catch (TableNotEnabledException e) {
//If table is not enabled, no need to throw exception. Continue.
- if (LOG.isTraceEnabled()) LOG.trace("deleteTable , TableNotEnabledException, Step: disableTable, TxId: " +
+ if (LOG.isTraceEnabled()) LOG.trace("deleteTable , TableNotEnabledException. This could be a expected exception. Step: disableTable, TxId: " +
transactionState.getTransactionId() + "TableName" + tblName + "Exception: " + e);
}
catch (Exception e) {
[2/2] incubator-trafodion git commit: Merge remote branch
'origin/pr/317/head' into merge_trafodion317
Posted by sa...@apache.org.
Merge remote branch 'origin/pr/317/head' into merge_trafodion317
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/8c5cce85
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/8c5cce85
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/8c5cce85
Branch: refs/heads/master
Commit: 8c5cce8595032b3b02ab36ea6d28243fd89e16e5
Parents: e9d2146 7c7f145
Author: Sandhya Sundaresan <sa...@apache.org>
Authored: Thu Feb 11 19:18:11 2016 +0000
Committer: Sandhya Sundaresan <sa...@apache.org>
Committed: Thu Feb 11 19:18:11 2016 +0000
----------------------------------------------------------------------
.../transactional/TransactionManager.java | 50 ++++++++++++++++++--
1 file changed, 47 insertions(+), 3 deletions(-)
----------------------------------------------------------------------