trafodion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject [2/3] incubator-trafodion git commit: Fix for Jira [TRAFODION-1935] part2 TransactionManager needlessly retries in doPrepareX when an UnknownTransactionException is caught
Date Wed, 27 Apr 2016 13:58:28 GMT
Fix for Jira [TRAFODION-1935] part2
TransactionManager needlessly retries in doPrepareX when an
UnknownTransactionException is caught


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/643b219c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/643b219c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/643b219c

Branch: refs/heads/master
Commit: 643b219cdcc8aa667bf5b5a2ebb2aba269eab94e
Parents: 32916f9
Author: Sean Broeder <sbroeder@edev03.esgyn.local>
Authored: Mon Apr 25 21:46:18 2016 +0000
Committer: Sean Broeder <sbroeder@edev03.esgyn.local>
Committed: Mon Apr 25 21:46:18 2016 +0000

----------------------------------------------------------------------
 .../transactional/TransactionManager.java       | 26 +++++++++-----------
 1 file changed, 12 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/643b219c/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 5d11497..3904253 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
@@ -381,7 +381,7 @@ public class TransactionManager {
                   // size is 1
                   for (CommitResponse cresponse : result.values()){
                     if(cresponse.getHasException()) {
-                      String exceptionString = new String (cresponse.getException().toString());
+                      String exceptionString = new String (cresponse.getException());
                       LOG.error("doCommitX - exceptionString: " + exceptionString);
                       if (exceptionString.contains("UnknownTransactionException")) {
                         if (ignoreUnknownTransaction == true) {
@@ -403,7 +403,7 @@ public class TransactionManager {
              else {
                   for (CommitResponse cresponse : result.values()){
                     if(cresponse.getHasException()) {
-                      String exceptionString = new String (cresponse.getException().toString());
+                      String exceptionString = new String (cresponse.getException());
                       LOG.error("doCommitX - exceptionString: " + exceptionString);
                       if (exceptionString.contains("UnknownTransactionException")) {
                         if (ignoreUnknownTransaction == true) {
@@ -530,7 +530,7 @@ public class TransactionManager {
                   // size is 1
                   for (SsccCommitResponse cresponse : result.values()){
                     if(cresponse.getHasException()) {
-                      String exceptionString = new String (cresponse.getException().toString());
+                      String exceptionString = new String (cresponse.getException());
                       if (exceptionString.contains("UnknownTransactionException")) {
                         if (ignoreUnknownTransaction == true) {
                           if (LOG.isTraceEnabled()) LOG.trace("doCommitX, ignoring UnknownTransactionException
in cresponse");
@@ -550,7 +550,7 @@ public class TransactionManager {
              }
           }
           catch (Exception e) {
-             if(e.toString().contains("UnknownTransactionException")) {
+             if(e instanceof UnknownTransactionException) {
                 String errMsg = new String("Got unknown exception in doCommitX by participant
" + participantNum
               		  + " for transaction: " + transactionId + " " + e);
                 LOG.error(errMsg);
@@ -747,7 +747,7 @@ public class TransactionManager {
           }
           catch(Exception e) {
              String exceptionString = e.toString();
-             if(exceptionString.contains("UnknownTransactionException")) {
+             if(e instanceof UnknownTransactionException) {
             	String errMsg = new String("doPrepareX participant " + participantNum + " transaction
"
                         + transactionId + " unknown transaction : " + e);
                 LOG.warn(errMsg);
@@ -851,7 +851,7 @@ public class TransactionManager {
           }
           catch(Exception e) {
              String exceptionString = e.toString();
-             if(exceptionString.contains("UnknownTransactionException")) {
+             if(e instanceof UnknownTransactionException) {
             	String errMsg = new String("doPrepareX participant " + participantNum + " transaction
"
                          + transactionId + " unknown transaction : " + e);
                 LOG.warn(errMsg);
@@ -1008,10 +1008,10 @@ public class TransactionManager {
               else {
                  for (AbortTransactionResponse cresponse : result.values()) {
                    if(cresponse.getHasException()) {
-                     String exceptionString = cresponse.getException().toString();
+                     String exceptionString = new String (cresponse.getException());
                      LOG.error("Abort of transaction: " + transactionId
-                    		 + " participantNum: " + participantNum + " region: " + Bytes.toString(regionName)
-                    		 + " threw Exception: " + exceptionString);
+                          + " participantNum: " + participantNum + " region: " + Bytes.toString(regionName)
+                          + " threw Exception: " + exceptionString);
                      if(exceptionString.contains("UnknownTransactionException")) {
                        throw new UnknownTransactionException();
                      }
@@ -1115,7 +1115,7 @@ public class TransactionManager {
                   else {
                      for (SsccAbortTransactionResponse cresponse : result.values()) {
                 if(cresponse.getHasException()) {
-                  String exceptionString = cresponse.getException().toString();
+                  String exceptionString = cresponse.getException();
                   LOG.error("Abort of transaction: " + transactionId + " threw Exception:
" + exceptionString);
                   if(exceptionString.contains("UnknownTransactionException")) {
                          throw new UnknownTransactionException();
@@ -1226,8 +1226,7 @@ public class TransactionManager {
            }
         }
         catch (Exception e) {
-           String exceptionString = e.toString();
-           if(exceptionString.contains("UnknownTransactionException")) {
+           if(e instanceof UnknownTransactionException) {
               String errMsg = new String("Got unknown exception in doCommitX for transaction:
" + transactionId
               		+ " participant " + participantNum + " " + e);
               LOG.error(errMsg);
@@ -1312,8 +1311,7 @@ public class TransactionManager {
           }
        }
        catch(Exception e) {
-          String exceptionString = e.toString();
-          if(exceptionString.contains("UnknownTransactionException")) {
+          if(e instanceof UnknownTransactionException) {
              String errMsg = new String("UnknownTransaction in doPrepareX - Batch - by participant
"
                      + participantNum + " for transaction " + transactionId + " " + e);
              LOG.error(errMsg);


Mime
View raw message