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

Introduce read write lock to Datanode

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.3.0
    • Fix Version/s: 3.3.0, 2.10.2
    • Component/s: datanode
    • Labels:
      None
    • Target Version/s:

      Description

      HDFS-9668 pointed out the issues around the DN lock being a point of contention some time ago, but that Jira went in a direction of creating a new FSDataset implementation which is very risky, and activity on the Jira has stalled for a few years now. Edit: Looks like HDFS-9668 eventually went in a similar direction to what I was thinking, so I will review that Jira in more detail to see if this one is necessary.

      I feel there could be significant gains by moving to a ReentrantReadWrite lock within the DN. The current implementation is simply a ReentrantLock so any locker blocks all others.

      Once place I think a read lock would benefit us significantly, is when the DN is serving a lot of small blocks and there are jobs which perform a lot of reads. The start of reading any blocks right now takes the lock, but if we moved this to a read lock, many reads could do this at the same time.

      The first conservative step, would be to change the current lock and then make all accesses to it obtain the write lock. That way, we should keep the current behaviour and then we can selectively move some lock accesses to the readlock in separate Jiras.

      I would appreciate any thoughts on this, and also if anyone has attempted it before and found any blockers.

        Attachments

        1. HDFS-15150.001.patch
          46 kB
          Stephen O'Donnell
        2. HDFS-15150.002.patch
          46 kB
          Stephen O'Donnell
        3. HDFS-15150.003.patch
          49 kB
          Stephen O'Donnell
        4. HDFS-15150-branch-2.10.001.patch
          46 kB
          Ahmed Hussein
        5. HDFS-15150-branch-2.10.002.patch
          47 kB
          Ahmed Hussein
        6. HDFS-15150-branch-2.10.003.patch
          46 kB
          Ahmed Hussein

          Issue Links

            Activity

              People

              • Assignee:
                sodonnell Stephen O'Donnell
                Reporter:
                sodonnell Stephen O'Donnell
              • Votes:
                0 Vote for this issue
                Watchers:
                15 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: