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

FSNamesystem should not sync the log with the write lock held

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • namenode
    • None

    Description

      FSNamesystem#deleteInternal releases the write lock before syncing the log, however FSNamesystem#startFileInternal calls delete -> deleteInternal with the write lock held, which means deleteInternal will sync the log while holding the lock. We could fix cases like this by passing a flag indicating whether the function should sysnc (eg in this case the sysnc is not necessary because startFileInternals callers will sync the log) or modify the current calls to sync to flag that a sync is necessary before returning to the caller rather than doing the sync right at the call sight. This way the cost of syncing the log could be amortized over multiple function calls (and potentially multiple RPCs if we didn't mind introducing some synchronization).

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              eli Eli Collins
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: