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
hbase hbck -j <path-to-hbck2-jar> generateMissingTableDescriptorFile [OPTIONS] [<TABLENAME>...]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:
Check for the table directory on HDFS
- If the directory does not exist, no action is taken.
Check for an existing .tableinfo file
- If it already exists, the command does nothing and does not overwrite the file.
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.
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
- Generate a missing table descriptor for
mytable:
hbase hbck -j <path-to-hbck2-jar> generateMissingTableDescriptorFile mytable- Generate missing table descriptors for all tables that require them:
hbase hbck -j <path-to-hbck2-jar> generateMissingTableDescriptorFile