hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From la...@apache.org
Subject [1/4] hbase git commit: HBASE-14822; addendum - handle callSeq.
Date Thu, 24 Dec 2015 21:03:20 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1 afaa7f843 -> 31f8d71ff
  refs/heads/branch-1.1 6b5645e37 -> 8ef49b314
  refs/heads/branch-1.2 a7889b5f4 -> ae8b3e061
  refs/heads/master a1a19d940 -> dfada43e9


HBASE-14822; addendum - handle callSeq.


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

Branch: refs/heads/master
Commit: dfada43e90a0767518501f6878bf9896bed912ce
Parents: a1a19d9
Author: Lars Hofhansl <larsh@apache.org>
Authored: Thu Dec 24 12:55:39 2015 -0800
Committer: Lars Hofhansl <larsh@apache.org>
Committed: Thu Dec 24 12:55:39 2015 -0800

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/regionserver/RSRpcServices.java  | 5 ++++-
 .../org/apache/hadoop/hbase/client/TestLeaseRenewal.java     | 8 ++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/dfada43e/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
index 75705e6..5d9b90f 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
@@ -2518,9 +2518,12 @@ public class RSRpcServices implements HBaseRPCErrorHandler,
       }
       assert scanner != null;
       if (request.hasRenew() && request.getRenew()) {
+        rsh = scanners.get(scannerName);
         lease = regionServer.leases.removeLease(scannerName);
-        if (lease != null && scanners.containsKey(scannerName)) {
+        if (lease != null && rsh != null) {
           regionServer.leases.addLease(lease);
+          // Increment the nextCallSeq value which is the next expected from client.
+          rsh.incNextCallSeq();
         }
         return builder.build();
       }

http://git-wip-us.apache.org/repos/asf/hbase/blob/dfada43e/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestLeaseRenewal.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestLeaseRenewal.java
b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestLeaseRenewal.java
index c89edf5..7170299 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestLeaseRenewal.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestLeaseRenewal.java
@@ -26,10 +26,13 @@ import java.util.Arrays;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.hbase.CompatibilityFactory;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.ipc.MetricsHBaseServerSource;
+import org.apache.hadoop.hbase.test.MetricsAssertHelper;
 import org.apache.hadoop.hbase.testclassification.LargeTests;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.junit.After;
@@ -41,6 +44,8 @@ import org.junit.experimental.categories.Category;
 
 @Category(LargeTests.class)
 public class TestLeaseRenewal {
+  public MetricsAssertHelper HELPER = CompatibilityFactory.getInstance(MetricsAssertHelper.class);
+
   final Log LOG = LogFactory.getLog(getClass());
   private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
   private static byte[] FAMILY = Bytes.toBytes("testFamily");
@@ -121,5 +126,8 @@ public class TestLeaseRenewal {
     assertFalse(rs.renewLease());
     rs.close();
     table.close();
+    MetricsHBaseServerSource serverSource = TEST_UTIL.getMiniHBaseCluster().getRegionServer(0)
+        .getRpcServer().getMetrics().getMetricsSource();
+    HELPER.assertCounter("exceptions.OutOfOrderScannerNextException", 0, serverSource);
   }
 }


Mime
View raw message