You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Yi Liang <wh...@gmail.com> on 2011/07/22 11:25:14 UTC

How to delete a region?

Hi all,

Is there a way to delete one region from table?

We now have two regions with the same startkey in our table, one of them is
wrong(it is empty), how can I delete it safely?

Thanks,
Yi

Re: How to delete a region?

Posted by Mayuresh <ma...@gmail.com>.
Have you tried major compact?
On Jul 22, 2011 2:55 PM, "Yi Liang" <wh...@gmail.com> wrote:
> Hi all,
>
> Is there a way to delete one region from table?
>
> We now have two regions with the same startkey in our table, one of them
is
> wrong(it is empty), how can I delete it safely?
>
> Thanks,
> Yi

Re: How to delete a region?

Posted by Yi Liang <wh...@gmail.com>.
Thanks J-D!

I have fixed the problem by manually deleting the .META. row as you
suggested.

'hbck -fix' didn't help as I have tried.

The problem is caused by running 'loadtable.rb' to load HFiles into an
existing empty table, the original empty region was not deleted after
loading, so there will be 2 regions with same start key ' '.  Not sure if it
is expected behavior.

Thanks,
Yi

On Fri, Jul 22, 2011 at 11:57 PM, Jean-Daniel Cryans <jd...@apache.org>wrote:

> I'd be first worried about how you got 2 regions with the same start key :)
>
> A major compaction won't do anything go in your case.
>
> I don't remember if hbck fixes that sort of situation, but worst case
> you can force close the region using the shell, then once it's really
> unassigned you can delete the .META. row (keep in mind its encoded
> name) and then in the filesystem move the contents from that region's
> folder to the other one and finally delete that folder.
>
> J-D
>
> On Fri, Jul 22, 2011 at 2:25 AM, Yi Liang <wh...@gmail.com> wrote:
> > Hi all,
> >
> > Is there a way to delete one region from table?
> >
> > We now have two regions with the same startkey in our table, one of them
> is
> > wrong(it is empty), how can I delete it safely?
> >
> > Thanks,
> > Yi
> >
>

Re: How to delete a region?

Posted by Jean-Daniel Cryans <jd...@apache.org>.
I'd be first worried about how you got 2 regions with the same start key :)

A major compaction won't do anything go in your case.

I don't remember if hbck fixes that sort of situation, but worst case
you can force close the region using the shell, then once it's really
unassigned you can delete the .META. row (keep in mind its encoded
name) and then in the filesystem move the contents from that region's
folder to the other one and finally delete that folder.

J-D

On Fri, Jul 22, 2011 at 2:25 AM, Yi Liang <wh...@gmail.com> wrote:
> Hi all,
>
> Is there a way to delete one region from table?
>
> We now have two regions with the same startkey in our table, one of them is
> wrong(it is empty), how can I delete it safely?
>
> Thanks,
> Yi
>