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

HFiles in use by a table which has the same name and namespace with a default table cloned from snapshot may be deleted when that snapshot and default table are deleted

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 1.1.12
    • 1.4.0, 1.3.2, 2.0.0-alpha-3, 2.0.0, 1.2.7
    • None
    • None
    • Reviewed
    • Patch

    Description

      We recently had a critical production issue in which HFiles that were still in use by a table were deleted.
      This appears to have been caused by conditions in which table have the same namespace and name with a default table cloned from snapshot.when snapshot and default table be deleted,HFiles that are still in use may be deleted.
      For example:
      Table with default namespace is: "t1"
      The namespace of the new table is the same as the name of the default table, and is generated by snapshot cloned : "t1: t1"
      When the snapshot and the default namespace table are deleted, the new table is also deleted in the used HFiles
      This is because the creation of the BackReferenceFile get the table Name is not normal, resulting in can not find the reference file, hfilecleaner to delete the HFiles in used, when the table has not been major compact

        public static boolean create(final Configuration conf, final FileSystem fs,
            final Path dstFamilyPath, final TableName linkedTable, final String linkedRegion,
            final String hfileName, final boolean createBackRef) throws IOException {
          String familyName = dstFamilyPath.getName();
          String regionName = dstFamilyPath.getParent().getName();
          String tableName = FSUtils.getTableName(dstFamilyPath.getParent().getParent())
              .getNameAsString();
      
        public static TableName getTableName(Path tablePath) {
          return TableName.valueOf(tablePath.getParent().getName(), tablePath.getName());
        }
      

      Attachments

        1. HBASE-18743-branch-1.patch
          3 kB
          wenbang
        2. HBASE_18743.patch
          0.6 kB
          wenbang
        3. HBASE_18743_v2.patch
          2 kB
          wenbang
        4. HBASE_18743_v1.patch
          1 kB
          wenbang

        Activity

          People

            wenbang wenbang
            wenbang wenbang
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: