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

Konstantin Shvachko commented on HDFS-15076:
--------------------------------------------

Attaching a patch. The fixes for {{TestDiskspaceQuotaUpdate}} and 
{{TestFSNamesystem}} are straightforward.
{{TestGetBlockLocations}} is a bit more tricky. It is trying to delete a file 
referenced via snapshot, while another thread is executing 
{{getBlockLocations()}}, right after releasing the {{readUnlock()}}, but just 
before {{writeLock()}}. This was done via mocking {{writeLock()}}, but will 
cause recursive calls if we want delete to be executed under write lock. So I 
changed it to mock the first call to 
{{checkOperation(OperationCategory.WRITE)}} - same effect. Also fixed 
{{testGetBlockLocationsRacingWithRename()}}, which used to invoke 
{{callRealMethod()}} before renaming, which doesn't cause the race with 
{{rename()}}.

> Fix tests that hold FSDirectory lock, without holding FSNamesystem lock.
> ------------------------------------------------------------------------
>
>                 Key: HDFS-15076
>                 URL: https://issues.apache.org/jira/browse/HDFS-15076
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: test
>            Reporter: Konstantin Shvachko
>            Priority: Major
>         Attachments: HDFS-15076.001.patch
>
>
> Three tests {{TestGetBlockLocations}}, {{TestFSNamesystem}}, 
> {{TestDiskspaceQuotaUpdate}} use {{FSDirectory}} methods, which hold 
> FSDirectory lock. They should also hold the global Namesystem lock.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
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