[ 
https://issues.apache.org/jira/browse/HDFS-17481?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

ZanderXu updated HDFS-17481:
----------------------------
        Parent:     (was: HDFS-17366)
    Issue Type: Bug  (was: Sub-task)

> [FGL] ComputeFileSize in INodeFile should avoid BM lock
> -------------------------------------------------------
>
>                 Key: HDFS-17481
>                 URL: https://issues.apache.org/jira/browse/HDFS-17481
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: ZanderXu
>            Assignee: ZanderXu
>            Priority: Major
>
> GetFileInfo is a very common used operations. The result FileStatus contains 
> the file size, which is computed by computeFileSize in InodeFile.
>  
> Since it involves the states of block, it needs to hold the BM readLock. But 
> holding the BM readLock will impact the performance, since getFileInfo is 
> very common used RPC.
>  
> As we all known, block size may be changed only by the following operations:
>  # fsync
>  # updatePipeline
>  # commit block
>  # commitBlockSynchronization
>  # truncate
>  # updates block in FSEditLogLoader
>  # forceCompleteBlock in FSEditLogLoader
>  
> All these above operations will be locked by the directory tree or global 
> write lock, so computeFileSize can be handled without holding BM Lock.
> But the BR and IBM may change the block status from COMMIT to COMPLETE even 
> through the block size is not changed. So computeFileSize cannot using 
> isComplete to compute the size of last block.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to