hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stack <st...@duboce.net>
Subject Re: Delete a region from hbase
Date Sun, 25 Jan 2015 03:03:18 GMT
On Sat, Jan 24, 2015 at 9:25 AM, Shuai Lin <linshuai2012@gmail.com> wrote:

> Hi all,
> We're using hbase 0.94-15 from CDH4 repo, and we're planning to delete
> several regions which contain data that are no longer needed.
> Basically we plan to use HRegion.deleteRegion
> <
> http://archive.cloudera.com/cdh4/cdh/4/hbase-0.94.2-cdh4.2.0/apidocs/org/apache/hadoop/hbase/regionserver/HRegion.html#deleteRegion%28org.apache.hadoop.fs.FileSystem,%20org.apache.hadoop.fs.Path,%20org.apache.hadoop.hbase.HRegionInfo%29
> >
> as described in this article.
> <
> http://prafull-blog.blogspot.jp/2012/06/how-to-delete-hbase-region-including.html
> >
> We can guarantee that  there would not be any request going to these
> regions during the deletion. Here are my questions:
> -- Is there any caveat of using this way to delete regions, especially
> those that may cause downtime? Because we'll delete the regions in our
> production cluster, we need really be careful of any possible consequences.
The blog is using an API that is @InterfaceAudience.Private  This means you
are taking a risk and all bets are off.

> -- After deleting the region, do we really need to re-create it? If we do
> not recreate these regions, there would be "holes" in the rowkey space. Can
> we use some tool like hbck to fix this? Another way is to just recreate the
> regions, and later merge these empty regions with their neighbors. Which
> one is better?

Better to avoid holes in your table.

Its probably less work just doing the delete yourself as in:

1. Close the region from the shell (read up on how this works using shell
help -- don't do unassign)
2. Then just delete the content of the region in HDFS once the region is
closed (the region dir name in HDFS is the same as the region encoded name,
the last portion of a region name -- check refguide).
3. After the delete in HDFS, call assign region.

Practice in a non-critical setup first.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message