Hadoop Common
  1. Hadoop Common
  2. HADOOP-6730

Bug in FileContext#copy and provide base class for FileContext tests

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.22.0
    • Fix Version/s: 0.22.0
    • Component/s: fs, test
    • Labels:
      None
    • Hadoop Flags:
      Incompatible change, Reviewed

      Description

      Thanks to Eli, He noticed that there is no test for FileContext#Copy operation.

      On further investigation with the help of Sanjay we found that there is bug in FileContext#checkDest.

        FileStatus dstFs = getFileStatus(dst);
          try {
            if (dstFs.isDir()) {
              if (null == srcNa
      

      FileStatus dstFs = getFileStatus(dst); should be in try...catch block.

          try {
             FileStatus dstFs = getFileStatus(dst);
             if (dstFs.isDir()) {
                if (null == srcNa
      
      1. HADOOP-6730.patch
        5 kB
        Ravi Phulari
      2. HADOOP-6730.2.patch
        7 kB
        Ravi Phulari
      3. HADOOP-6730.3.patch
        6 kB
        Ravi Phulari
      4. HADOOP-6730.4.patch
        6 kB
        Ravi Phulari

        Activity

        Konstantin Shvachko made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Jakob Homan made changes -
        Resolution Fixed [ 1 ]
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Hadoop Flags [Reviewed] [Incompatible change, Reviewed]
        Jakob Homan made changes -
        Summary Bug in FileContext#copy Bug in FileContext#copy and provide base class for FileContext tests
        Hadoop Flags [Reviewed]
        Fix Version/s 0.21.0 [ 12313563 ]
        Affects Version/s 0.21.0 [ 12313563 ]
        Component/s test [ 12311440 ]
        Ravi Phulari made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Ravi Phulari made changes -
        Attachment HADOOP-6730.4.patch [ 12443315 ]
        Ravi Phulari made changes -
        Attachment HADOOP-6730.3.patch [ 12443309 ]
        Ravi Phulari made changes -
        Attachment HADOOP-6730.2.patch [ 12443267 ]
        Ravi Phulari made changes -
        Fix Version/s 0.21.0 [ 12313563 ]
        Affects Version/s 0.21.0 [ 12313563 ]
        Ravi Phulari made changes -
        Attachment HADOOP-6730.patch [ 12443227 ]
        Ravi Phulari made changes -
        Summary FileContext#copy needs unit tests Bug in FileContext#copy
        Description I modifed FileContext#checkDest in HADOOP-6678 and noticed it's only caller FileContext#copy has no callers itself. It needs unit tests. Thanks to Eli, He noticed that there is no test for FileContext#Copy operation.

        On further investigation with the help of Sanjay we found that there is bug in FileContext#checkDest.

        {noformat}
          FileStatus dstFs = getFileStatus(dst);
            try {
              if (dstFs.isDir()) {
                if (null == srcNa
        {noformat}


         *FileStatus dstFs = getFileStatus(dst);* should be in try...catch block.

        {noformat}
            try {
               FileStatus dstFs = getFileStatus(dst);
               if (dstFs.isDir()) {
                  if (null == srcNa
        {noformat}


        Ravi Phulari made changes -
        Field Original Value New Value
        Assignee Ravi Phulari [ raviphulari ]
        Eli Collins created issue -

          People

          • Assignee:
            Ravi Phulari
            Reporter:
            Eli Collins
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development