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

Call recoverLease on DFSOutputStream close exception

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.4.0
    • 3.4.0
    • hdfs-client
    • None
    • Reviewed

    Description

      HDFS uses file-lease to manage opened files, when a file is not closed normally, NN will recover lease automatically after hard limit exceeded. But for a long running service(e.g. HBase), the hdfs-client will never die and NN don't have any chances to recover the file.

      Usually client program needs to handle exceptions by themself to avoid this condition(e.g. HBase automatically call recover lease for files that not closed normally), but in our experience, most services (in our company) don't process this condition properly, which will cause lots of files in abnormal status or even data loss.

      This Jira propose to add a feature that call recoverLease operation automatically when DFSOutputSteam close encounters exception. It should be disabled by default, but when somebody builds a long-running service based on HDFS, they can enable this option.

      We've add this feature to our internal Hadoop distribution for more than 3 years, it's quite useful according our experience.

      Attachments

        1. HDFS-14694.001.patch
          8 kB
          Chen Zhang
        2. HDFS-14694.002.patch
          7 kB
          Chen Zhang
        3. HDFS-14694.003.patch
          8 kB
          Chen Zhang
        4. HDFS-14694.004.patch
          8 kB
          Chen Zhang
        5. HDFS-14694.005.patch
          8 kB
          Lisheng Sun
        6. HDFS-14694.006.patch
          8 kB
          Lisheng Sun
        7. HDFS-14694.007.patch
          8 kB
          Lisheng Sun
        8. HDFS-14694.008.patch
          7 kB
          Lisheng Sun
        9. HDFS-14694.009.patch
          7 kB
          Lisheng Sun
        10. HDFS-14694.010.patch
          8 kB
          Lisheng Sun
        11. HDFS-14694.011.patch
          8 kB
          Lisheng Sun
        12. HDFS-14694.012.patch
          9 kB
          Lisheng Sun
        13. HDFS-14694.013.patch
          9 kB
          Lisheng Sun
        14. HDFS-14694.014.patch
          9 kB
          Lisheng Sun

        Issue Links

          Activity

            People

              leosun08 Lisheng Sun
              zhangchen Chen Zhang
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: