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

BlockPoolSliceScanner#getNewBlockScanTime does not handle numbers > 31 bits properly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Cannot Reproduce
    • None
    • None
    • None
    • None

    Description

      This code does not handle the case where period > 2**31 properly:

          long period = Math.min(scanPeriod, 
                                 Math.max(blockMap.size(),1) * 600 * 1000L);
          int periodInt = Math.abs((int)period);
          return System.currentTimeMillis() - scanPeriod + 
              DFSUtil.getRandom().nextInt(periodInt);
      

      So, for example, if period = 0x100000000, we'll map that to 0, and so forth.

      Attachments

        1. HDFS-3488.001.patch
          2 kB
          Colin McCabe

        Issue Links

          Activity

            People

              cmccabe Colin McCabe
              cmccabe Colin McCabe
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: