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

Add a configurable limit on number of blocks per file, and min block size

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.0.4, 2.0.4-alpha
    • 2.1.0-beta
    • namenode
    • None
    • Incompatible change, Reviewed
    • Hide
      This change introduces a maximum number of blocks per file, by default one million, and a minimum block size, by default 1MB. These can optionally be changed via the configuration settings "dfs.namenode.fs-limits.max-blocks-per-file" and "dfs.namenode.fs-limits.min-block-size", respectively.
      Show
      This change introduces a maximum number of blocks per file, by default one million, and a minimum block size, by default 1MB. These can optionally be changed via the configuration settings "dfs.namenode.fs-limits.max-blocks-per-file" and "dfs.namenode.fs-limits.min-block-size", respectively.

    Description

      We recently had an issue where a user set the block size very very low and managed to create a single file with hundreds of thousands of blocks. This caused problems with the edit log since the OP_ADD op was so large (HDFS-4304). I imagine it could also cause efficiency issues in the NN. To prevent users from making such mistakes, we should:

      • introduce a configurable minimum block size, below which requests are rejected
      • introduce a configurable maximum number of blocks per file, above which requests to add another block are rejected (with a suitably high default as to not prevent legitimate large files)

      Attachments

        1. hdfs-4305-1.patch
          7 kB
          Andrew Wang
        2. hdfs-4305-2.patch
          9 kB
          Andrew Wang
        3. hdfs-4305-3.patch
          9 kB
          Andrew Wang

        Issue Links

          Activity

            People

              andrew.wang Andrew Wang
              tlipcon Todd Lipcon
              Votes:
              0 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: