[ https://issues.apache.org/jira/browse/HDFS-1605?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14536106#comment-14536106 ]
kartheek muthyala commented on HDFS-1605: ----------------------------------------- Hi [~raviprak] , thanks for pointing out the bug. Yes these two methods are also needs to be synchronized through a single lock. We can extend the same logic and take a lock on getCurrentDataNode function too. Fundamentally, the patch would hold write locks on the synchronized functions and would hold read locks on the functions that threads from HBase invoke such as getFileLength() and getBlockAt(). I can submit a new patch with resolving the bug. Let me know. > Convert DFSInputStream synchronized sections to a ReadWrite lock > ---------------------------------------------------------------- > > Key: HDFS-1605 > URL: https://issues.apache.org/jira/browse/HDFS-1605 > Project: Hadoop HDFS > Issue Type: Improvement > Components: hdfs-client > Reporter: dhruba borthakur > Labels: BB2015-05-TBR > Attachments: DFSClientRWlock.1.txt, DFSClientRWlock.3.txt, > HADOOP-1605-trunk.patch, HDFS-1605.txt > > > Hbase does concurrent preads from multiple threads to different blocks of the > same hdfs file. Each of these pread calls invoke > DFSInputStream.getFileLength() and DFSInputStream.getBlockAt(). These methods > are "synchronized", thus causing all the concurrent threads to serialize. It > would help performance to convert this to a Read/Write lock -- This message was sent by Atlassian JIRA (v6.3.4#6332)