[ 
https://issues.apache.org/jira/browse/HBASE-23321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16980551#comment-16980551
 ] 

Nick Dimiduk commented on HBASE-23321:
--------------------------------------

{noformat}
@@ -99,11 +98,13 @@ class MetaFixer {
       HRegion.createRegionDir(configuration, ri, 
FSUtils.getRootDir(configuration));
       // If an error here, then we'll have a region in the filesystem but not
       // in hbase:meta (if the below fails). Should be able to rerun the fix.
-      // The second call to createRegionDir will just go through. Idempotent.
-      Put put = MetaTableAccessor.makePutFromRegionInfo(ri, 
HConstants.LATEST_TIMESTAMP);
-      MetaTableAccessor.putsToMetaTable(this.masterServices.getConnection(),
-          Collections.singletonList(put));
-      LOG.info("Fixed hole by adding {}; region is NOT assigned (assign to 
online).", ri);
+      // Add to hbase:meta and then update in-memory state so it knows of new
+      // Region; addRegionToMeta adds region and adds a state column set to 
CLOSED.
+      MetaTableAccessor.addRegionToMeta(this.masterServices.getConnection(), 
ri);
+      this.masterServices.getAssignmentManager().getRegionStates().
+          updateRegionState(ri, RegionState.State.CLOSED);
+      LOG.info("Fixed hole by adding {} in CLOSED state; region NOT assigned 
(assign to ONLINE).",
+          ri);
     }
   }{noformat}
 

This is good. I wonder – after looping through all the holes, is there a way to 
fast-track getting these new regions assigned? Some "need assignment run" flag 
we can tickle to get things going all the sooner?

+1

> [hbck2] fixHoles of fixMeta doesn't update in-memory state
> ----------------------------------------------------------
>
>                 Key: HBASE-23321
>                 URL: https://issues.apache.org/jira/browse/HBASE-23321
>             Project: HBase
>          Issue Type: Improvement
>          Components: hbck2
>            Reporter: Michael Stack
>            Assignee: Michael Stack
>            Priority: Minor
>             Fix For: 3.0.0, 2.3.0, 2.2.3
>
>
> If hbase:meta has holes, you can run fixMeta from hbck2. This will close the 
> holes but you have to restart the Master for it to notice the new region 
> additions. Also, we were plugging holes by adding regions but no state for 
> the region which makes it awkward to subsequently assign. Fix.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to