HBASE-14822; addendum - handle callSeq.
This commit is contained in:
parent
afaa7f843a
commit
31f8d71ffe
|
@ -2386,9 +2386,12 @@ public class RSRpcServices implements HBaseRPCErrorHandler,
|
||||||
ttl = this.scannerLeaseTimeoutPeriod;
|
ttl = this.scannerLeaseTimeoutPeriod;
|
||||||
}
|
}
|
||||||
if (request.hasRenew() && request.getRenew()) {
|
if (request.hasRenew() && request.getRenew()) {
|
||||||
|
rsh = scanners.get(scannerName);
|
||||||
lease = regionServer.leases.removeLease(scannerName);
|
lease = regionServer.leases.removeLease(scannerName);
|
||||||
if (lease != null && scanners.containsKey(scannerName)) {
|
if (lease != null && rsh != null) {
|
||||||
regionServer.leases.addLease(lease);
|
regionServer.leases.addLease(lease);
|
||||||
|
// Increment the nextCallSeq value which is the next expected from client.
|
||||||
|
rsh.incNextCallSeq();
|
||||||
}
|
}
|
||||||
return builder.build();
|
return builder.build();
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,10 +26,13 @@ import java.util.Arrays;
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
import org.apache.hadoop.hbase.CompatibilityFactory;
|
||||||
import org.apache.hadoop.hbase.HBaseTestingUtility;
|
import org.apache.hadoop.hbase.HBaseTestingUtility;
|
||||||
import org.apache.hadoop.hbase.HConstants;
|
import org.apache.hadoop.hbase.HConstants;
|
||||||
import org.apache.hadoop.hbase.HTableDescriptor;
|
import org.apache.hadoop.hbase.HTableDescriptor;
|
||||||
import org.apache.hadoop.hbase.TableName;
|
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.testclassification.LargeTests;
|
||||||
import org.apache.hadoop.hbase.util.Bytes;
|
import org.apache.hadoop.hbase.util.Bytes;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
|
@ -41,6 +44,8 @@ import org.junit.experimental.categories.Category;
|
||||||
|
|
||||||
@Category(LargeTests.class)
|
@Category(LargeTests.class)
|
||||||
public class TestLeaseRenewal {
|
public class TestLeaseRenewal {
|
||||||
|
public MetricsAssertHelper HELPER = CompatibilityFactory.getInstance(MetricsAssertHelper.class);
|
||||||
|
|
||||||
final Log LOG = LogFactory.getLog(getClass());
|
final Log LOG = LogFactory.getLog(getClass());
|
||||||
private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
|
private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
|
||||||
private static byte[] FAMILY = Bytes.toBytes("testFamily");
|
private static byte[] FAMILY = Bytes.toBytes("testFamily");
|
||||||
|
@ -121,5 +126,8 @@ public class TestLeaseRenewal {
|
||||||
assertFalse(((AbstractClientScanner)rs).renewLease());
|
assertFalse(((AbstractClientScanner)rs).renewLease());
|
||||||
rs.close();
|
rs.close();
|
||||||
table.close();
|
table.close();
|
||||||
|
MetricsHBaseServerSource serverSource = TEST_UTIL.getMiniHBaseCluster().getRegionServer(0)
|
||||||
|
.getRpcServer().getMetrics().getMetricsSource();
|
||||||
|
HELPER.assertCounter("exceptions.OutOfOrderScannerNextException", 0, serverSource);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue