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

Use file to replace data dirs in test to simulate a disk failure.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.6.0
    • 2.7.0
    • test
    • None
    • Reviewed

    Description

      Currently, in several tests, e.g., TestDataNodeVolumeFailureXXX and TestDataNotHowSwapVolumes, we simulate a disk failure by setting a directory's executable permission as false. However, it raises the risk that if the cleanup code could not be executed, the directory can not be easily removed by Jenkins job.

      Since in DiskChecker#checkDirAccess:

      private static void checkDirAccess(File dir) throws DiskErrorException {
          if (!dir.isDirectory()) {
            throw new DiskErrorException("Not a directory: "
                                         + dir.toString());
          }
      
          checkAccessByFileMethods(dir);
        }
      

      We can replace the DN data directory as a file to achieve the same fault injection goal, while it is safer for cleaning up in any circumstance. Additionally, as cnauroth suggested:

      That might even let us enable some of these tests that are skipped on Windows, because Windows allows access for the owner even after permissions have been stripped.

      Attachments

        1. HDFS-7917.000.patch
          15 kB
          Lei (Eddy) Xu
        2. HDFS-7917.001.patch
          15 kB
          Lei (Eddy) Xu
        3. HDFS-7917.002.patch
          16 kB
          Lei (Eddy) Xu

        Activity

          People

            eddyxu Lei (Eddy) Xu
            eddyxu Lei (Eddy) Xu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: