[
https://issues.apache.org/jira/browse/HBASE-17904?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15966781#comment-15966781
]
huaxiang sun commented on HBASE-17904:
--------------------------------------
add a new test case in TestReplicaWithCluster to explore the issue.
{code}
@Test
public void testReplicaGetWithRpcClientImpl() throws IOException {
HTU.getConfiguration().setBoolean("hbase.ipc.client.specificThreadForWriting",
true);
HTU.getConfiguration().set("hbase.rpc.client.impl",
"org.apache.hadoop.hbase.ipc.RpcClientImpl");
// Create table then get the single region for our new table.
HTableDescriptor hdt =
HTU.createTableDescriptor("testReplicaGetWithRpcClientImpl");
hdt.setRegionReplication(NB_SERVERS);
hdt.addCoprocessor(SlowMeCopro.class.getName());
try {
Table table = HTU.createTable(hdt, new byte[][] { f }, null);
Put p = new Put(row);
p.addColumn(f, row, row);
table.put(p);
// Flush so it can be picked by the replica refresher thread
HTU.flush(table.getName());
// Sleep for some time until data is picked up by replicas
try {
Thread.sleep(2 * REFRESH_PERIOD);
} catch (InterruptedException e1) {
LOG.error(e1);
}
try {
// Create the new connection so new config can kick in
Connection connection =
ConnectionFactory.createConnection(HTU.getConfiguration());
Table t = connection.getTable(hdt.getTableName());
// But if we ask for stale we will get it
SlowMeCopro.cdl.set(new CountDownLatch(1));
Get g = new Get(row);
g.setConsistency(Consistency.TIMELINE);
Result r = t.get(g);
Assert.assertTrue(r.isStale());
SlowMeCopro.cdl.get().countDown();
} finally {
SlowMeCopro.cdl.get().countDown();
SlowMeCopro.sleepTime.set(0);
}
} finally {
HTU.getConfiguration().unset("hbase.ipc.client.specificThreadForWriting");
HTU.getConfiguration().unset("hbase.rpc.client.impl");
HTU.getAdmin().disableTable(hdt.getTableName());
HTU.deleteTable(hdt.getTableName());
}
}
{code}
> Get runs into NoSuchElementException when using Read Replica, with hbase.
> ipc.client.specificThreadForWriting to be true and hbase.rpc.client.impl to
> be org.apache.hadoop.hbase.ipc.RpcClientImpl
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: HBASE-17904
> URL: https://issues.apache.org/jira/browse/HBASE-17904
> Project: HBase
> Issue Type: Bug
> Components: Client
> Affects Versions: 2.0.0
> Reporter: huaxiang sun
> Assignee: huaxiang sun
>
> When testing read replica with 2.0.0 code, with the following config
> {code}
> <property>
> <name>hbase.ipc.client.specificThreadForWriting</name>
> <value>true</value>
> </property>
> <property>
> <name>hbase.rpc.client.impl</name>
> <value>org.apache.hadoop.hbase.ipc.RpcClientImpl</value>
> </property>
> {code}
> The hbase client runs into the following exception
> {code}
> Exception in thread "main" java.util.NoSuchElementException
> at java.util.ArrayDeque.removeFirst(ArrayDeque.java:280)
> at java.util.ArrayDeque.remove(ArrayDeque.java:447)
> at
> org.apache.hadoop.hbase.ipc.BlockingRpcConnection$CallSender.remove(BlockingRpcConnection.java:159)
> at
> org.apache.hadoop.hbase.ipc.BlockingRpcConnection$3.run(BlockingRpcConnection.java:760)
> at
> org.apache.hadoop.hbase.ipc.HBaseRpcControllerImpl.startCancel(HBaseRpcControllerImpl.java:229)
> at
> org.apache.hadoop.hbase.client.CancellableRegionServerCallable.cancel(CancellableRegionServerCallable.java:86)
> at
> org.apache.hadoop.hbase.client.ResultBoundedCompletionService$QueueingFuture.cancel(ResultBoundedCompletionService.java:106)
> at
> org.apache.hadoop.hbase.client.ResultBoundedCompletionService.cancelAll(ResultBoundedCompletionService.java:274)
> at
> org.apache.hadoop.hbase.client.RpcRetryingCallerWithReadReplicas.call(RpcRetryingCallerWithReadReplicas.java:224)
> at org.apache.hadoop.hbase.client.HTable.get(HTable.java:445)
> at org.apache.hadoop.hbase.client.HTable.get(HTable.java:409)
> at HBaseThreadedGet.doWork(HBaseThreadedGet.java:45)
> at HBaseThreadedGet.main(HBaseThreadedGet.java:19)
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)