Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-4634

"test.build.data" property overused leading to write data at the wrong place

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.92.0
    • 0.92.0
    • test
    • None
    • all

    • Reviewed

    Description

      "test.build.data" is overloaded in HBase.At the beginning, it's the "Default parent directory for test output.", but then it's rewritten to be the directory itself in functions like HBaseTestingUtility#startMiniDFSCluster

      It seems that this value is already used by MiniDFS (i.e. outside of HBase):
      "Name is as it is because mini dfs has hard-codings to put test data here."

      As it is today, there is at least a bug in HBaseTestingUtility:

        public void initTestDir() {
          if (System.getProperty(TEST_DIRECTORY_KEY) == null) {
            clusterTestBuildDir = setupClusterTestBuildDir();
            System.setProperty(TEST_DIRECTORY_KEY, clusterTestBuildDir.getPath());
          }
        }
      

      if you set a value for "test.build.data", the test dir will be the parent directory and not a temp subdir, leading to issues as multiple tests will end-ups in the same (bad) directory. This function is barely used today, hence it's not visible, but I would like to use it in some new code.

      A possible fix is to remove the check for null and continue with the overloading, but I don't think it would be a big issue to create a new key(like "test.build.data.rootdirectory") specific to the root directory and to use "test.build.data" only to communicate with MiniDFS. Feedback welcome.

      Attachments

        1. 2011020_4634_all.patch
          46 kB
          Nicolas Liochon
        2. 20111020_4639_TestStoreFile.patch
          2 kB
          Nicolas Liochon
        3. 20111021_4634_all.v2.patch
          105 kB
          Nicolas Liochon
        4. 20111022_4634_all.v3.patch
          109 kB
          Nicolas Liochon
        5. 20111023_4634_all.v4.patch
          122 kB
          Nicolas Liochon
        6. 20111024_4634_all.v5.patch
          119 kB
          Nicolas Liochon

        Issue Links

          Activity

            People

              nkeywal Nicolas Liochon
              nkeywal Nicolas Liochon
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: