generateMissingTableDescriptorFile (Hbck2)

Attempts to repair an orphan table—one that has a table directory on HDFS but no corresponding .tableinfo descriptor file—by generating the missing descriptor file.

Command Syntax

Bash
Copy

Description

This command generates a missing .tableinfo file for one or more orphan tables. It does not modify HBase metadata; it only writes the generated file to the filesystem.

The command performs the following steps:

  1. Check for the table directory on HDFS

    • If the directory does not exist, no action is taken.
  2. Check for an existing .tableinfo file

    • If it already exists, the command does nothing and does not overwrite the file.
  3. Attempt recovery using the cached TableDescriptor

    • If the HBase Master has the TableDescriptor cached in memory, it uses that cached copy to reconstruct the .tableinfo file accurately.
  4. If no cached descriptor is available, the command creates a default descriptor containing:

    • The table name
    • Column families discovered by scanning the filesystem (subdirectories in the table directory)
    • Default properties for the TableDescriptor and each ColumnFamilyDescriptor

When a .tableinfo file is generated using default values (i.e., without a cached descriptor), you must manually review and update the table and column family properties later. The autogenerated parameters are defaults and may not match the table’s intended configuration.

Orphan tables can also lead to other operational issues, such as stuck ServerCrashProcedures. Additional cleanup may be required after generating the missing descriptor files.

If no table names are specified, the command generates missing .tableinfo files for all tables with missing descriptors across the cluster.

Examples

  1. Generate a missing table descriptor for mytable:
Bash
Copy
  1. Generate missing table descriptors for all tables that require them:
Bash
Copy
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard
  Last updated