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

Jonathan Gray commented on HBASE-2694:
--------------------------------------

This issue will include:
- Introduction of an {{UNASSIGNED}} znode/directory into ZK which will contain 
a znode for each region in transition.  Data of the region znodes will contain 
the state of the region (closing, closed, opening, opened)
- Introduction of a custom executor service, {{HBaseExecutorService}}, which is 
a special type of named thread pool which will be used to process events
- Introduction of {{HBaseEventHandler}} interface which is the type executed by 
the HBaseExecutorService
- Two event handlers, {{MasterOpenRegionHandler}} and 
{{MasterCloseRegionHandler}}, to handle open/close events on the master side.  
For this jira, they will actually not contain new logic and will just call the 
existing open/close implementations.

The existing message flow for moving a region from one RS to another (close 
then open):
# M -> RS1: MSG_REGION_CLOSE (via piggybacking on the response to the RS 
heartbeat)
# RS1 -> M: MSG_REPORT_CLOSE (on heartbeat)
# M:  Offline in META
# M:  MetaScanner picks up unassigned region
# M -> RS2: MSG_REGION_OPEN (via piggybacking on the response to the RS 
heartbeat)
# RS2 -> M: MSG_REPORT_PROCESS_OPEN (sent on each heartbeat until region is 
opened)
# RS2 -> M: MSG_REPORT_OPEN (on heartbeat)
# M: Add opened region to meta

The new message flow:
# M -> RS1: MSG_REGION_CLOSE (via piggybacking on the response to the RS 
heartbeat)
# RS1 -> ZK: Create ZNode {{/UNASSIGNED/regionname(CLOSING)}}
# ZK -> M:  Detects new region in transition, sets watcher on regionname znode
# RS1 -> ZK: Update ZNode {{/UNASSIGNED/regionname(CLOSED)}}
# ZK -> M:  Detects region as closed, offline in META
# M:  MetaScanner picks up unassigned region
# M -> RS2: MSG_REGION_OPEN (via piggybacking on the response to the RS 
heartbeat)
# RS2 -> ZK: Update ZNode {{/UNASSIGNED/regionname(OPENING)}}
# RS2 -> ZK: Update ZNode {{/UNASSIGNED/regionname(OPENED)}}
# ZK -> M: Detects region as opened, add opened region to meta
# M -> ZK: Delete ZNode {{/UNASSIGNED/regionname}}

> Move RS to Master region open/close messaging into ZooKeeper
> ------------------------------------------------------------
>
>                 Key: HBASE-2694
>                 URL: https://issues.apache.org/jira/browse/HBASE-2694
>             Project: HBase
>          Issue Type: Sub-task
>          Components: master, regionserver
>            Reporter: Jonathan Gray
>            Priority: Critical
>             Fix For: 0.21.0
>
>
> As a first step towards HBASE-2485, this issue is about changing the message 
> flow of opening and closing of regions without actually changing the 
> implementation of what happens on both the Master and RegionServer sides.  
> This way we can debug the messaging changes before the introduction of more 
> significant changes to the master architecture and handling of regions in 
> transition.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to