Review Board 1.7.22

HBASE-5986 - Clients can see holes in the META table when regions are being split

Review Request #5133 - Created May 16, 2012 and updated

We found this issue when running large scale ingestion tests for HBASE-5754. The problem is that the .META. table updates are not atomic while splitting a region. In SplitTransaction, there is a time lap between the marking the parent offline, and adding of daughters to the META table. This can result in clients using MetaScanner, of HTable.getStartEndKeys (used by the TableInputFormat) missing regions which are made just offline, but the daughters are not added yet.

This patch is the approach 2 mentioned in the issue comments, mainly during META scan, if we detect that the region is split, we block until the information for the child regions are available in META and manually feed those rows to the MetaScanner. Although approach 3 (using local region transactions) seems cleaner, they are not available under branch 0.92, which I think should also incorporate this fix. I'll provide ports once we are clear for trunk. 

Also this patch does not fix MetaReader (see 
added extensive tests under TestEndToEndSplitTranscation, and ran existing unit tests. 
Review request changed
Updated (May 23, 2012, 10:28 p.m.)
 - incorporated Ted's comments
 - Change MetaScanner to be Private (per offline conversation with Stack)