Hadoop HDFS
  1. Hadoop HDFS
  2. HDFS-1835

DataNode.setNewStorageID pulls entropy from /dev/random

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.20.2
    • Fix Version/s: 0.23.0
    • Component/s: datanode
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      DataNode.setNewStorageID uses SecureRandom.getInstance("SHA1PRNG") which always pulls fresh entropy.

      It wouldn't be so bad if this were only the 120 bits needed by sha1, but the default impl of SecureRandom actually uses a BufferedInputStream around /dev/random and pulls 1024 bits of entropy for this one call.

      If you are on a system without much entropy coming in, this call can block and block others.

      Can we just change this to use "new SecureRandom().nextInt(Integer.MAX_VALUE)" instead?

      1. hdfs-1835.txt
        0.8 kB
        Todd Lipcon
      2. DataNode.patch
        0.9 kB
        John Carrino

        Issue Links

          Activity

          Arun C Murthy made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Eli Collins made changes -
          Link This issue is related to HDFS-2335 [ HDFS-2335 ]
          Eli Collins made changes -
          Assignee John Carrino [ johnyoh ]
          Todd Lipcon made changes -
          Status Patch Available [ 10002 ] Resolved [ 5 ]
          Hadoop Flags [Reviewed]
          Fix Version/s 0.23.0 [ 12315571 ]
          Fix Version/s 0.22.0 [ 12314241 ]
          Resolution Fixed [ 1 ]
          Todd Lipcon made changes -
          Attachment hdfs-1835.txt [ 12479213 ]
          John Carrino made changes -
          Attachment DataNode.patch [ 12476682 ]
          John Carrino made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          John Carrino made changes -
          Status Patch Available [ 10002 ] Open [ 1 ]
          John Carrino made changes -
          Field Original Value New Value
          Status Open [ 1 ] Patch Available [ 10002 ]
          Fix Version/s 0.22.0 [ 12314241 ]
          John Carrino created issue -

            People

            • Assignee:
              John Carrino
              Reporter:
              John Carrino
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 10m
                10m
                Remaining:
                Remaining Estimate - 10m
                10m
                Logged:
                Time Spent - Not Specified
                Not Specified

                  Development