Package org.apache.hadoop.hbase.client
Class TestClientOperationTimeout
java.lang.Object
org.apache.hadoop.hbase.client.TestClientOperationTimeout
These tests verify that the RPC timeouts ('hbase.client.operation.timeout' and
'hbase.client.scanner.timeout.period') work correctly using a modified Region Server which
injects delays to get, scan and mutate operations.
When 'hbase.client.operation.timeout' is set and client operation is not completed in time the
client will retry the operation 'hbase.client.retries.number' times. After that
SocketTimeoutException
will be thrown.
Using 'hbase.client.scanner.timeout.period' configuration property similar behavior can be
specified for scan related operations such as openScanner(), next(). If that times out
RetriesExhaustedException
will be thrown.-
Nested Class Summary
Modifier and TypeClassDescriptionprivate static class
static class
ThisRSRpcServices
class injects delay for Rpc calls and after executes super methods. -
Field Summary
Modifier and TypeFieldDescriptionstatic final HBaseClassTestRule
private static org.apache.hadoop.hbase.client.Connection
private static int
private static int
private static int
private static int
private static int
private static boolean
private static final byte[]
private static final byte[]
private static final byte[]
private static org.apache.hadoop.hbase.client.Table
private static final org.apache.hadoop.hbase.TableName
private static final HBaseTestingUtility
private static final byte[]
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate void
assertMultiException
(org.junit.function.ThrowingRunnable runnable) AsyncProcess has an overall waitUntilDone with a timeout, and if all callables dont finish by then it throws a SocketTimeoutException.void
setUp()
static void
static void
tearDown()
void
Tests that a get on a table throwsRetriesExhaustedException
when the operation takes longer than 'hbase.client.operation.timeout'.void
Tests that a batch get on a table throwsOperationTimeoutExceededException
when the region lookup takes longer than the 'hbase.client.operation.timeout'.void
Tests that a batch get on a table throwsOperationTimeoutExceededException
when retries are tuned too high to be able to be processed within the operation timeout.void
Tests that a batch mutate and batch get on a table throwsSocketTimeoutException
orOperationTimeoutExceededException
when the operation takes longer than 'hbase.client.operation.timeout'.void
Tests that a put on a table throwsRetriesExhaustedException
when the operation takes longer than 'hbase.client.operation.timeout'.void
Tests that scan on a table throwsRetriesExhaustedException
when the operation takes longer than 'hbase.client.scanner.timeout.period'.
-
Field Details
-
CLASS_RULE
-
UTIL
-
DELAY_GET
-
DELAY_SCAN
-
DELAY_MUTATE
-
DELAY_BATCH
-
DELAY_META_SCAN
-
FAIL_BATCH
-
TABLE_NAME
-
FAMILY
-
ROW
-
QUALIFIER
-
VALUE
-
CONN
-
TABLE
-
-
Constructor Details
-
TestClientOperationTimeout
public TestClientOperationTimeout()
-
-
Method Details
-
setUpClass
- Throws:
Exception
-
setUp
- Throws:
Exception
-
tearDown
- Throws:
Exception
-
testGetTimeout
Tests that a get on a table throwsRetriesExhaustedException
when the operation takes longer than 'hbase.client.operation.timeout'. -
testPutTimeout
Tests that a put on a table throwsRetriesExhaustedException
when the operation takes longer than 'hbase.client.operation.timeout'. -
testMultiTimeout
Tests that a batch mutate and batch get on a table throwsSocketTimeoutException
orOperationTimeoutExceededException
when the operation takes longer than 'hbase.client.operation.timeout'. -
assertMultiException
AsyncProcess has an overall waitUntilDone with a timeout, and if all callables dont finish by then it throws a SocketTimeoutException. The callables themselves also try to honor the operation timeout and result in OperationTimeoutExceededException (wrapped in RetriesExhausted). The latter is the more user-friendly exception because it contains details about which server has issues, etc. For now we need to account for both because it's sort of a race to see which timeout exceeds first. Maybe we can replace the waitUntilDone behavior with an interrupt in the future so we can further unify. -
testMultiGetMetaTimeout
Tests that a batch get on a table throwsOperationTimeoutExceededException
when the region lookup takes longer than the 'hbase.client.operation.timeout'. This specifically tests that when meta is slow, the fetching of region locations for a batch is not allowed to itself exceed the operation timeout. In a batch size of 100, it's possible to need to make 100 meta calls in sequence. If meta is slow, we should abort the request once the operation timeout is exceeded, even if we haven't finished locating all regions. See HBASE-27490- Throws:
IOException
-
testMultiGetRetryTimeout
Tests that a batch get on a table throwsOperationTimeoutExceededException
when retries are tuned too high to be able to be processed within the operation timeout. In this case, the final OperationTimeoutExceededException should not trigger a cache clear (but the individual failures may, if appropriate). This test skirts around the timeout checks during meta lookups from HBASE-27490, because we want to test for the case where meta lookups were able to succeed in time but did not leave enough time for the actual calls to occur. See HBASE-27487 -
testScanTimeout
Tests that scan on a table throwsRetriesExhaustedException
when the operation takes longer than 'hbase.client.scanner.timeout.period'.
-