You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by su...@apache.org on 2015/10/19 20:14:07 UTC

[1/3] incubator-trafodion git commit: [TRAFODION-1531] Hitting WrongRegionException

Repository: incubator-trafodion
Updated Branches:
  refs/heads/master 876de2d7f -> fe1a77ebe


[TRAFODION-1531] Hitting WrongRegionException

This change will help debug the issue and keep the database consistent.
It adds a checkRow() method on the server-side put and delete to make
sure the row key belongs in the region at DML time vs commit time.

Also adding a configuration property that would be set in hbase-site.xml
hbase.transaction.check.row
default is 'true'
true  - enable checkRow() code
false - skips the check


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

Branch: refs/heads/master
Commit: 45d3e496453757995d6cc87153877a90537b530f
Parents: 7bb805d
Author: Oliver Bucaojit <ol...@esgyn.com>
Authored: Fri Oct 16 19:18:24 2015 +0000
Committer: Oliver Bucaojit <ol...@esgyn.com>
Committed: Fri Oct 16 19:18:24 2015 +0000

----------------------------------------------------------------------
 .../transactional/TrxRegionEndpoint.java        | 36 +++++++-------------
 1 file changed, 13 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/45d3e496/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionEndpoint.java
----------------------------------------------------------------------
diff --git a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionEndpoint.java b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionEndpoint.java
index e426159..2d740c8 100755
--- a/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionEndpoint.java
+++ b/core/sqf/src/seatrans/hbase-trx/src/main/java/org/apache/hadoop/hbase/coprocessor/transactional/TrxRegionEndpoint.java
@@ -357,6 +357,7 @@ CoprocessorService, Coprocessor {
   private static final String MEMORY_CONF = "hbase.transaction.memory.sleep";
   private static final String MEMORY_PERFORM_GC = "hbase.transaction.memory.perform.GC";
   private static final String SUPPRESS_OOP = "hbase.transaction.suppress.OOP.exception";
+  private static final String CHECK_ROW = "hbase.transaction.check.row";
   protected static int transactionLeaseTimeout = 0;
   private static int scannerLeaseTimeoutPeriod = 0;
   private static int scannerThreadWakeFrequency = 0;
@@ -367,6 +368,7 @@ CoprocessorService, Coprocessor {
   private static float memoryPercentage = 0;
   private static boolean memoryThrottle = false;
   private static boolean suppressOutOfOrderProtocolException = DEFAULT_SUPPRESS_OOP;
+  private static boolean checkRowBelongs = true;
 
   // Transaction state defines
   private static final int COMMIT_OK = 1;
@@ -2899,7 +2901,7 @@ CoprocessorService, Coprocessor {
         this.memoryUsagePerformGC = conf.getBoolean(MEMORY_PERFORM_GC, DEFAULT_MEMORY_PERFORM_GC);
         this.memoryUsageWarnOnly = conf.getBoolean(MEMORY_WARN_ONLY, DEFAULT_MEMORY_WARN_ONLY);
         this.memoryUsageTimer = conf.getInt(MEMORY_CONF, DEFAULT_MEMORY_SLEEP);
-        this.memoryUsageTimer = conf.getInt(MEMORY_CONF, DEFAULT_MEMORY_SLEEP);
+        this.checkRowBelongs = conf.getBoolean(CHECK_ROW, true);
 
         this.suppressOutOfOrderProtocolException = conf.getBoolean(SUPPRESS_OOP, DEFAULT_SUPPRESS_OOP);
 	if (this.transactionLeases == null)  
@@ -3635,6 +3637,8 @@ CoprocessorService, Coprocessor {
   public void delete(final long transactionId, final Delete delete)
     throws IOException {
     if (LOG.isTraceEnabled()) LOG.trace("TrxRegionEndpoint coprocessor: delete -- ENTRY txId: " + transactionId);
+    if(this.checkRowBelongs)
+      checkRow(delete.getRow(), "Delete");
     TrxTransactionState state = this.beginTransIfNotExist(transactionId);
     state.addDelete(delete);
   }
@@ -3653,6 +3657,8 @@ CoprocessorService, Coprocessor {
     TrxTransactionState state = this.beginTransIfNotExist(transactionId);
 
     for (Delete del : deletes) {
+      if(this.checkRowBelongs)
+        checkRow(del.getRow(), "Delete");
       state.addDelete(del);
     }
   }
@@ -3682,17 +3688,8 @@ CoprocessorService, Coprocessor {
     byte[] startKey = null;
     byte[] endKey = null;
 
-    if (!this.m_Region.rowIsInRange(this.regionInfo, row)) {
-      startKey = this.regionInfo.getStartKey();
-      endKey = this.regionInfo.getEndKey();
-      LOG.error("Requested row out of range for " +
-       "checkAndDelete for txid " + transactionId + ", on HRegion " +
-       this + ", startKey=[" + Bytes.toStringBinary(startKey) +
-       "], startKey in hex[" + Hex.encodeHexString(startKey) +
-       "], endKey [" + Bytes.toStringBinary(endKey) +
-       "], endKey in hex[" + Hex.encodeHexString(endKey) + "]" +
-       "], row=[" + Bytes.toStringBinary(row) + "]");
-     }
+    if(this.checkRowBelongs)
+      checkRow(row, "checkAndDelete");
 
     try {
 
@@ -3756,17 +3753,8 @@ CoprocessorService, Coprocessor {
     byte[] startKey = null;
     byte[] endKey = null;
 
-    if (!this.m_Region.rowIsInRange(this.regionInfo, row)) {
-      startKey = this.regionInfo.getStartKey();
-      endKey = this.regionInfo.getEndKey();
-      LOG.error("Requested row out of range for " +
-       "checkAndPut for txid " + transactionId + ", on HRegion " +
-       this + ", startKey=[" + Bytes.toStringBinary(startKey) +
-       "], startKey in hex[" + Hex.encodeHexString(startKey) +
-       "], endKey [" + Bytes.toStringBinary(endKey) +
-       "], endKey in hex[" + Hex.encodeHexString(endKey) + "]" +
-       "], row=[" + Bytes.toStringBinary(row) + "]");
-     }
+    if(this.checkRowBelongs)
+      checkRow(row, "checkAndPut");
 
     try {
       Get get = new Get(row);
@@ -3943,6 +3931,8 @@ CoprocessorService, Coprocessor {
   public void put(final long transactionId, final Put put)
     throws IOException {
     if (LOG.isTraceEnabled()) LOG.trace("Enter TrxRegionEndpoint coprocessor: put, txid: " + transactionId);
+    if(this.checkRowBelongs)
+      checkRow(put.getRow(),"Put");
     TrxTransactionState state = this.beginTransIfNotExist(transactionId);
 
     state.addWrite(put);


[3/3] incubator-trafodion git commit: Merge remote branch 'origin/pr/130/head' into mrg_66

Posted by su...@apache.org.
Merge remote branch 'origin/pr/130/head' into mrg_66


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

Branch: refs/heads/master
Commit: fe1a77ebe365ddc98149e781edf3fb6a8f1fc30c
Parents: 876de2d c7931fb
Author: Suresh Subbiah <su...@apache.org>
Authored: Mon Oct 19 18:13:34 2015 +0000
Committer: Suresh Subbiah <su...@apache.org>
Committed: Mon Oct 19 18:13:34 2015 +0000

----------------------------------------------------------------------
 .../transactional/TrxRegionEndpoint.java        | 36 +++++++-------------
 1 file changed, 13 insertions(+), 23 deletions(-)
----------------------------------------------------------------------



[2/3] incubator-trafodion git commit: Merge branch 'master' of github.com:apache/incubator-trafodion into jira_1531

Posted by su...@apache.org.
Merge branch 'master' of github.com:apache/incubator-trafodion into jira_1531


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

Branch: refs/heads/master
Commit: c7931fbd8be185f8a88b62276d358fd03102cdff
Parents: 45d3e49 46f7be4
Author: Oliver Bucaojit <ol...@esgyn.com>
Authored: Fri Oct 16 19:24:56 2015 +0000
Committer: Oliver Bucaojit <ol...@esgyn.com>
Committed: Fri Oct 16 19:24:56 2015 +0000

----------------------------------------------------------------------
 core/conn/jdbc_type4/src/T4Messages.properties  |  7 ++++
 .../src/org/trafodion/jdbc/t4/HPT4Messages.java | 23 +++++-----
 .../org/trafodion/jdbc/t4/TrafT4ResultSet.java  |  6 +--
 core/rest/bin/scripts/sys_shell.py              | 42 +++++++++----------
 dcs/src/test/pytests/test_p2.py                 | 44 ++++++++++----------
 5 files changed, 62 insertions(+), 60 deletions(-)
----------------------------------------------------------------------