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

ASF GitHub Bot commented on HDFS-16764:
---------------------------------------

xinglin commented on PR #4872:
URL: https://github.com/apache/hadoop/pull/4872#issuecomment-1272617400

   nit: maybe change the PR title to "Fix ObserverNN to throw 
ObserverRetryOnActiveException when receiving addBlock RPC, instead of 
FileNotFoundException"
   
   And in the description, add "addBlock() is a WRITE operation on FSNamespace. 
We changed a few checkOperation(READ) to checkOperation(WRITE) in addBlock() so 
that the check will fail with a correct exception when running by ObserverNNs".
   
   Sure, could you ping me for the PRs you want me to take a look? I am not a 
hadoop committer but can take a look when I have bandwidth.
   




> ObserverNamenode handles addBlock rpc and throws a FileNotFoundException 
> -------------------------------------------------------------------------
>
>                 Key: HDFS-16764
>                 URL: https://issues.apache.org/jira/browse/HDFS-16764
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: ZanderXu
>            Assignee: ZanderXu
>            Priority: Critical
>              Labels: pull-request-available
>
> ObserverNameNode currently can handle the addBlockLocation RPC, but it may 
> throw a FileNotFoundException when it contains stale txid.
>  * AddBlock is not a coordinated method, so Observer will not check the 
> statId.
>  * AddBlock does the validation with checkOperation(OperationCategory.READ)
> So the observer can handle the addBlock rpc. If this observer cannot replay 
> the edit of create file, it will throw a FileNotFoundException during doing 
> validation.
> The related code as follows:
> {code:java}
> checkOperation(OperationCategory.READ);
> final FSPermissionChecker pc = getPermissionChecker();
> FSPermissionChecker.setOperationType(operationName);
> readLock();
> try {
>   checkOperation(OperationCategory.READ);
>   r = FSDirWriteFileOp.validateAddBlock(this, pc, src, fileId, clientName,
>                                         previous, onRetryBlock);
> } finally {
>   readUnlock(operationName);
> } {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to