[ 
https://issues.apache.org/jira/browse/HBASE-20686?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16542494#comment-16542494
 ] 

Wei-Chiu Chuang commented on HBASE-20686:
-----------------------------------------

Thanks [~chia7712] for review comments. I removed unwrapping other exceptions 
because they are not part of focus. 

Attach v002 patch. I realized the check for RetryStartFileException was in the 
code, but it was checked at the wrong place – RetryStartFileException is thrown 
from NameNode when a create() RPC is called. So removed the check of the 
exception that was previously there incorrectly.

In addition, added a test to verify the check & retry is successful. The test 
code is very hacky because I had to replace a static final variable 
(FileCreator) in FanOutOneBlockAsyncDFSOutputHelper for test. The test code 
uses Java reflection to forcefully replace FileCreator. This approach was 
inspired by this web page: 
[https://caffinc.github.io/2015/12/static-final-java-junit-test/]

[~Apache9] how do you feel about this test approach? I tried a few approaches 
but this one is the "cleanest" one.

> Asyncfs should retry upon RetryStartFileException
> -------------------------------------------------
>
>                 Key: HBASE-20686
>                 URL: https://issues.apache.org/jira/browse/HBASE-20686
>             Project: HBase
>          Issue Type: Bug
>          Components: asyncclient
>    Affects Versions: 2.0.0-beta-1
>         Environment: HBase 2.0, Hadoop 3 with at-rest encryption
>            Reporter: Wei-Chiu Chuang
>            Assignee: Wei-Chiu Chuang
>            Priority: Major
>         Attachments: HBASE-20686.master.001.patch, 
> HBASE-20686.master.002.patch
>
>
> In Hadoop-2.6 and above, HDFS client retries on RetryStartFileException when 
> NameNode experience encryption zone related issue. The code exists in 
> DFSOutputStream#newStreamForCreate(). (HDFS-6970)
> In HBase-2's asyncfs implementation, 
> FanOutOneBlockAsyncDFSOutputHelper#createOutput() is somewhat an imitation of 
> HDFS's DFSOutputStream#newStreamForCreate(). However it does not retry upon 
> RetryStartFileException. So it is less resilient to such issues.
> Also, DFSOutputStream#newStreamForCreate() upwraps RemoteExceptions, but 
> asyncfs does not. Therefore, hbase gets different exceptions than before.
> File this jira to get this corrected.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to