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

Editlog should support synchronous writes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1-win, 3.0.0-alpha1
    • 1-win, 2.1.0-beta
    • None
    • None
    • Reviewed

    Description

      In the current implementation, NameNode editlog performs syncs to the persistent storage using the FileChannel#force Java APIs. This API is documented to be slower compared to an alternative where RandomAccessFile is opened with "rws" flags (synchronous writes).

      We instrumented FileChannel#force on Windows and it some software/hardware configurations it can perform significantly slower than the “rws” alternative.

      In terms of the Windows APIs, FileChannel#force internally calls FlushFileBuffers while RandomAccessFile (“rws”) opens the file with the FILE_FLAG_WRITE_THROUGH flag.

      With this Jira I'd like to introduce a flag that provide means to configure NameNode to use synchronous writes. There is a catch though, the behavior of the "rws" flags is platform and hardware specific and might not provide the same level of guarantees as FileChannel#force w.r.t. flushing the on-disk cache. This is an expert level setting, and it should be documented as such.

      Attachments

        1. HDFS-4677.2.patch
          8 kB
          Ivan Mitic
        2. HDFS-4677.3.patch
          30 kB
          Ivan Mitic
        3. HDFS-4677.3.patch
          30 kB
          Chris Nauroth
        4. HDFS-4677.branch-1-win.2.patch
          4 kB
          Ivan Mitic
        5. HDFS-4677.branch-1-win.patch
          4 kB
          Ivan Mitic
        6. HDFS-4677.patch
          4 kB
          Ivan Mitic

        Issue Links

          Activity

            People

              ivanmi Ivan Mitic
              ivanmi Ivan Mitic
              Votes:
              0 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: