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

Yi Liang edited comment on HBASE-18105 at 8/23/17 12:20 AM:
------------------------------------------------------------

Hi [~stack]
   I just do some investigation in the code, When split successful, it will 
1.set its region state as SPLIT and 2. set HRI.split=true, and then put 
serialized version of the HRegionInfo into META table. But for merge, it will 
only set regionstate as MERGE, and not put HRI to META. 
   I think the reason is that after split, meta and HDFS will still contain 
references to the parent region, so we need to keep this parent region, and 
mark it as split in HRI. However after merge, we just delete the two merged 
regions, they are not useful anymore, all info move to the the new region. I 
think that is the reason why they keep transition state in the HRI, and there 
is only SPLIT and no MERGE.

   {quote}HRI should be read-only for life of the Region?{quote}
   Yes, HRI should be immutable, and in split, current code will copy the 
parent HRI and set HRI.split=true and then put into META

Overall, there are still some places in split and merge needs to be cleaned up. 
   


was (Author: easyliangjob):
Hi [~stack]
   I just do some investigation in the code, When split successful, it will 
1.set its region state as SPLIT and 2. set HRI.split=true, and then put 
serialized version of the HRegionInfo into META table. But for merge, it will 
only set regionstate as MERGE, and not put HRI to META. 
   I think the reason is that after split, meta and HDFS will still contain 
references to the parent region, so we need to keep this parent region, and 
mark it as split in HRI. However after merge, we just delete the two merged 
regions, they are not useful anymore, all info move to the the new region. I 
think that is the reason why they keep transition state in the HRI, and there 
is only SPLIT and no MERGE.

   {quote}HRI should be read-only for life of the Region?{quote}
   Yes, HRI should be immutable, and in split, current code will copy the 
parent HRI and set HRI.split=true and then put. 

Overall, there are still some places in split and merge needs to be cleaned up. 
   

> [AMv2] Split/Merge need cleanup; currently they diverge and do not fully 
> embrace AMv2 world
> -------------------------------------------------------------------------------------------
>
>                 Key: HBASE-18105
>                 URL: https://issues.apache.org/jira/browse/HBASE-18105
>             Project: HBase
>          Issue Type: Sub-task
>          Components: Region Assignment
>    Affects Versions: 2.0.0
>            Reporter: stack
>             Fix For: 2.0.0
>
>
> Region Split and Merge work on the new AMv2 but they work differently. This 
> issue is about bringing them back together and fully embracing the AMv2 
> program.
> They both have issues mostly the fact that they carry around baggage no 
> longer necessary in the new world of assignment.
> Here are some of the items:
> Split and Merge metadata modifications are done by the Master now but we have 
> vestige of Split/Merge on RS still; e.g. when we SPLIT, we ask the Master 
> which asks the RS, which turns around, and asks the Master to run the 
> operation. Fun. MERGE is all done Master-side.
>  
> Clean this up. Remove asking RS to run SPLIT and remove RegionMergeRequest, 
> etc. on RS-side. Also remove PONR. We don’t Points-Of-No-Return now we are up 
> on Pv2. Remove all calls in Interfaces; they are unused. Make RS still able 
> to detect when split, but have it be a client of Master like anyone else.
> Split is Async but does not return procId
> Split is async. Doesn’t return the procId though. Merge does. Fix. Only hard 
> part here I think is the Admin API does not allow procid return.
> Flags
> Currently OFFLINE is determined by looking either at the master instance of 
> HTD (isOffline) and/or at the RegionState#state. Ditto for SPLIT. For MERGE, 
> we rely on RegionState#state. Related is a note above on how split works -- 
> there is a split flag in HTD when there should not be.
>  
> TODO is move to rely on RegionState#state exclusively in Master.
> From Split/Merge Procedures need finishing in 
> https://docs.google.com/document/d/1eVKa7FHdeoJ1-9o8yZcOTAQbv0u0bblBlCCzVSIn69g/edit#heading=h.4b60dc1h4m1f



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to