Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-13359

DataXceiver hung due to the lock in FsDatasetImpl#getBlockInputStream

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.7.1
    • Fix Version/s: 3.3.0, 3.2.1, 3.1.3
    • Component/s: datanode
    • Labels:
      None
    • Target Version/s:

      Description

      DataXceiver hung due to the lock that locked by
      FsDatasetImpl#getBlockInputStream (have attached stack).

        @Override // FsDatasetSpi
        public InputStream getBlockInputStream(ExtendedBlock b,
            long seekOffset) throws IOException {
      
          ReplicaInfo info;
          synchronized(this) {
            info = volumeMap.get(b.getBlockPoolId(), b.getLocalBlock());
          }
          ...
        }
      

      The lock synchronized(this) used here is expensive, there is already one AutoCloseableLock type lock defined for ReplicaMap. We can use it instead.

        Attachments

        1. HDFS-13359.001.patch
          0.8 kB
          Yiqun Lin
        2. stack.jpg
          249 kB
          Yiqun Lin

          Issue Links

            Activity

              People

              • Assignee:
                linyiqun Yiqun Lin
                Reporter:
                linyiqun Yiqun Lin
              • Votes:
                0 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: