Details
Description
Support executing region merge transaction on Regionserver, similar with split transaction
Process of merging two regions:
a.client sends RPC (dispatch merging regions) to master
b.master moves the regions together (on the same regionserver where the more heavily loaded region resided)
c.master sends RPC (merge regions) to this regionserver
d.Regionserver executes the region merge transaction in the thread pool
e.the above b,c,d run asynchronously
Process of region merge transaction:
a.Construct a new region merge transaction.
b.prepare for the merge transaction, the transaction will be canceled if it is unavailable,
e.g. two regions don't belong to same table; two regions are not adjacent in a non-compulsory merge; region is closed or has reference
c.execute the transaction as the following:
/**
- Set region as in transition, set it into MERGING state.
*/
SET_MERGING_IN_ZK,
/** - We created the temporary merge data directory.
*/
CREATED_MERGE_DIR,
/** - Closed the merging region A.
*/
CLOSED_REGION_A,
/** - The merging region A has been taken out of the server's online regions list.
*/
OFFLINED_REGION_A,
/** - Closed the merging region B.
*/
CLOSED_REGION_B,
/** - The merging region B has been taken out of the server's online regions list.
*/
OFFLINED_REGION_B,
/** - Started in on creation of the merged region.
*/
STARTED_MERGED_REGION_CREATION,
/** - Point of no return. If we got here, then transaction is not recoverable
- other than by crashing out the regionserver.
*/
PONR
d.roll back if step c throws exception
Usage:
HBaseAdmin#mergeRegions
See more details from the patch
Attachments
Attachments
Issue Links
- blocks
-
HBASE-7629 Master initiated automatic region merges
- Closed
- is related to
-
HBASE-5487 Generic framework for Master-coordinated tasks
- Closed
- relates to
-
HBASE-1621 merge tool should work on online cluster
- Closed
-
HBASE-5504 Online Merge
- Closed