[
https://issues.apache.org/jira/browse/HBASE-22567?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16896609#comment-16896609
]
stack edited comment on HBASE-22567 at 7/31/19 9:35 PM:
--------------------------------------------------------
-[~wchevreuil] One thing I've noticed working on fixing holes is that if that
after scanning to find SINGLE REGION WIDE holes and then using the hole edges
to create the regioninfo that covers the hole, if I use the new RegionInfo to
try and create the corresponding directory in the filesystem, it fails because
the directory already exists (with any data it may have had in it). I've made
it so if existing directory we just use it rather than create a new one. This
works for the case of a single region missing from table but it won't work for
the case covered here where a bunch of contiguous regions are missing from
hbase:meta but their data is in the fs; in this latter case, the tool added
here will restore data and fill holes. Just something I noticed...-
Above didn't seem right and it isn't. I had bug in my fill holes code. Ignore
the above assertion.
was (Author: stack):
[~wchevreuil] One thing I've noticed working on fixing holes is that if that
after scanning to find SINGLE REGION WIDE holes and then using the hole edges
to create the regioninfo that covers the hole, if I use the new RegionInfo to
try and create the corresponding directory in the filesystem, it fails because
the directory already exists (with any data it may have had in it). I've made
it so if existing directory we just use it rather than create a new one. This
works for the case of a single region missing from table but it won't work for
the case covered here where a bunch of contiguous regions are missing from
hbase:meta but their data is in the fs; in this latter case, the tool added
here will restore data and fill holes. Just something I noticed...
> HBCK2 addMissingRegionsToMeta
> -----------------------------
>
> Key: HBASE-22567
> URL: https://issues.apache.org/jira/browse/HBASE-22567
> Project: HBase
> Issue Type: New Feature
> Components: hbck2
> Reporter: Wellington Chevreuil
> Assignee: Wellington Chevreuil
> Priority: Major
>
> Following latest discussion on HBASE-21745, this proposes an hbck2 command
> that allows for inserting back regions missing in META that still have
> *regioninfo* available in HDFS. Although this is still an interactive and
> simpler version than the old _OfflineMetaRepair_, it still relies on hdfs
> state as the source of truth, and performs META updates mostly independently
> from Master (apart from requiring Meta table been online).
> For a more detailed explanation on this command behaviour, pasting _command
> usage_ text:
> {noformat}
> To be used for scenarios where some regions may be missing in META,
> but there's still a valid 'regioninfo' metadata file on HDFS.
> This is a lighter version of 'OfflineMetaRepair' tool commonly used for
> similar issues on 1.x release line.
> This command needs META to be online. For each table name passed as
> parameter, it performs a diff between regions available in META,
> against existing regions dirs on HDFS. Then, for region dirs with
> no matches in META, it reads regioninfo metadata file and
> re-creates given region in META. Regions are re-created in 'CLOSED'
> state at META table only, but not in Masters' cache, and are not
> assigned either. A rolling Masters restart, followed by a
> hbck2 'assigns' command with all re-inserted regions is required.
> This hbck2 'assigns' command is printed for user convenience.
> WARNING: To avoid potential region overlapping problems due to ongoing
> splits, this command disables given tables while re-inserting regions.
> An example adding missing regions for tables 'table_1' and 'table_2':
> $ HBCK2 addMissingRegionsInMeta table_1 table_2
> Returns hbck2 'assigns' command with all re-inserted regions.{noformat}
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)