Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-15109

TestDFSIO -read -random doesn't work on file sized 4GB

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.0.0-beta1
    • 3.1.0
    • fs, test
    • None

    Description

      TestDFSIO -read -random throws IllegalArgumentException on 4GB file. The cause is:

      private long nextOffset(long current) {
            if(skipSize == 0)
              return rnd.nextInt((int)(fileSize));
            if(skipSize > 0)
              return (current < 0) ? 0 : (current + bufferSize + skipSize);
            // skipSize < 0
            return (current < 0) ? Math.max(0, fileSize - bufferSize) :
                                   Math.max(0, current + skipSize);
          }
        }
      

      When filesize exceeds signed int, (int)(filesize) will be negative and cause Random.nextInt throws IllegalArgumentException("n must be positive").

      Attachments

        1. HADOOP-15109.001.patch
          1 kB
          Ajay Kumar
        2. HADOOP-15109.002.patch
          2 kB
          Ajay Kumar
        3. Screen Shot 2017-12-11 at 3.17.22 PM.png
          112 kB
          Ajay Kumar

        Activity

          People

            ajayydv Ajay Kumar
            zhoutai.zt zhoutai.zt
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: