Originally, addFsRegionsMissingInMeta relied on MetaTableAccessor to add new regions, which correctly added new regions in CLOSED state.
HBASE-23791 removed dependency on MetaTableAccessor as to avoid relying on HBase IA private methods. MetaTableAccessor functions needed by HBCK2 were then re-implemented on HBCKMetaTableAccessor. Implementation for addRegionToMeta, though, was not fully ported, and it was not setting newly added regions state.
This would cause attempts to assign the newly added regions to fail, as AM ignore regions without state defined in meta, requiring extra calls for hbck2 setRegionState command for each of the newly added regions.
Kudos for Toshihiro Suzuki who identified this problem while troubleshooting/fixing regions assignments issues with hbck2.
This PR fix implementation of HBCKMetaTableAccessor.addRegionToMeta to insert new regions with CLOSED state, and also adds extra checks for this behaviour on both TestHBCKMetaTableAccessor and TestFsRegionsMetaRecoverer UTs.