[
https://issues.apache.org/jira/browse/HBASE-4991?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13214071#comment-13214071
]
Mubarak Seyed commented on HBASE-4991:
--------------------------------------
@Stack
Thanks for the review
bq.Do we need to add this method to the region server interface?
bq.{code}
+ public int getRegionsCount(byte[] regionName) throws IOException;
{code}
bq.Can we not just count what comes back from the get on online regions?
We need to get the counts per table, _getOnlineRegions_ returns _List<HRegion>_
for a table but client does not know the _tableName_ for a _regionName_ in our
case, either we can do two calls (one for getting _HRegionInfo_ and get
_tableName_ from there and next one for getting _List<HRegion>_). I thought we
can simplify by adding a new interface.
{code}
public int getRegionsCount(byte[] regionName) throws IOException {
return getOnlineRegions(getRegionInfo(regionName).getTableName())
.size();
}
{code}
bq. Do we have to run the region delete in the Master process? Can the client
not do it?
Design choice is like
[HBASE-4213|https://issues.apache.org/jira/browse/HBASE-4213], meaning master
create a znode under _<zookeeper.znode.parent>/delete-region_ then RS trackers
are getting notified of children changed, then a RS which hosts the region
to-be-deleted will process the delete-region request and update the state in
_<zookeeper.znode.parent>/delete-region/<encoded-region-name-to-be-deleted>_
znode.
bq.Is it really necessary adding + public MasterDeleteRegionTracker
getDeleteRegionTracker(); to the MasterServices? This will have a ripple effect
through Tests and it seems like a bit of an exotic API to have in this basic
Interface.
Will think a bit more and update you
bq.Does all of this new code need to be in HRegionServer? Can it live in a
class of its own?
Like to hear the comments from code review, we can refactor to helper class.
bq. There must be a million holes here (HRS crashes in middle of file moving or
creation of the merged region, files partially moved or deleted....).
I believe _delete-region_ state in ZK will help to recover from failures, need
more testcases with individual failure scenarios such as HRS crash, failure of
merged region, failure of file remove in HDFS, failure of new region directory
creation in HDFS, partial files, etc, will add them when i do stress test for
Todd's suggestion
bq. Does this code all need to be in core? Can we not make a few primitives and
then run it all from outside in a tool or script w/ state recorded as we go so
can resume if fail mid-way? There are a bunch of moving pieces here. Its all
bundled up in core code so its going to be tough to test.
If we are considering _delete_region_ as a tool/util then we can refactor as a
tool/util as like Online/Offline merge code.
bq.Adding this to onlineregions, + public void deleteRegion(String regionName)
throws IOException, KeeperException;, do all removals from online regions now
use this new API (Its probably good having it here... but just wondering about
the places where regions currently get removed from online map, do they go a
different route than this new one?)
New API _deleteRegion()_ does more than just removing from online region(s) map
but other places we use
{code}
public boolean removeFromOnlineRegions(final String encodedName)
{code}
Its being called from _openRegion()_, _refreshRegion()_, _createDaughters()_ in
_SplitTransaction_ and _CloseRegionHandler_
bq. How hard will it be to reuse parts to do say an online merge of a bunch of
adjacent regions?
Once Todd's proposal is implemented, will find out a way to do more refactoring
(to cut down repeated code)
bq. Are the enums duplicated?
Yes, will take care of it in refactoring.
bq. Why does zookeeper package have classes particular to master and
regionserver?
We do put all our ZK trackers in zookeeper package and this is how online
schema change [HBASE-4213|https://issues.apache.org/jira/browse/HBASE-4213] was
implemented.
> Provide capability to delete named region
> -----------------------------------------
>
> Key: HBASE-4991
> URL: https://issues.apache.org/jira/browse/HBASE-4991
> Project: HBase
> Issue Type: Improvement
> Reporter: Ted Yu
> Assignee: Mubarak Seyed
> Fix For: 0.94.0
>
> Attachments: HBASE-4991.trunk.v1.patch, HBASE-4991.trunk.v2.patch
>
>
> See discussion titled 'Able to control routing to Solr shards or not' on
> lily-discuss
> User may want to quickly dispose of out of date records by deleting specific
> regions.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira