Return-Path: X-Original-To: apmail-hbase-issues-archive@www.apache.org Delivered-To: apmail-hbase-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A31C8CF96 for ; Thu, 19 Jul 2012 23:30:36 +0000 (UTC) Received: (qmail 99827 invoked by uid 500); 19 Jul 2012 23:30:36 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 99773 invoked by uid 500); 19 Jul 2012 23:30:36 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 99622 invoked by uid 99); 19 Jul 2012 23:30:36 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Jul 2012 23:30:36 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id 3BC15142866 for ; Thu, 19 Jul 2012 23:30:35 +0000 (UTC) Date: Thu, 19 Jul 2012 23:30:35 +0000 (UTC) From: "Jonathan Hsieh (JIRA)" To: issues@hbase.apache.org Message-ID: <173676166.79408.1342740635247.JavaMail.jiratomcat@issues-vm> In-Reply-To: <14458130.228841294496085421.JavaMail.jira@thor> Subject: [jira] [Commented] (HBASE-3432) [hbck] Add "remove table" switch MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HBASE-3432?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13418792#comment-13418792 ] Jonathan Hsieh commented on HBASE-3432: --------------------------------------- [juneng603] eventually, after region assignments are completed and the region is opened on the target RS, information is updated in the META table so that other clients can go to the proper RS. > [hbck] Add "remove table" switch > -------------------------------- > > Key: HBASE-3432 > URL: https://issues.apache.org/jira/browse/HBASE-3432 > Project: HBase > Issue Type: New Feature > Components: util > Affects Versions: 0.89.20100924 > Reporter: Lars George > Priority: Minor > > This happened before and I am not sure how the new Master improves on it (this stuff is only available between the lines are buried in some peoples heads - one other thing I wish was for a better place to communicate what each path improves). Just so we do not miss it, there is an issue that sometimes disabling large tables simply times out and the table gets stuck in limbo. > From the CDH User list: > {quote} > On Fri, Jan 7, 2011 at 1:57 PM, Sean Sechrist wrote: > To get them out of META, you can just scan '.META.' for that table name, and delete those rows. We had to do that a few months ago. > -Sean > That did it. For the benefit of others, here's code. Beware the literal table names, run at your own peril. > {quote} > {code} > import java.io.IOException; > import org.apache.hadoop.conf.Configuration; > import org.apache.hadoop.hbase.HBaseConfiguration; > import org.apache.hadoop.hbase.client.HTable; > import org.apache.hadoop.hbase.client.Delete; > import org.apache.hadoop.hbase.client.Result; > import org.apache.hadoop.hbase.client.MetaScanner; > import org.apache.hadoop.hbase.util.Bytes; > public class CleanFromMeta { > public static class Cleaner implements MetaScanner.MetaScannerVisitor { > public HTable meta = null; > public Cleaner(Configuration conf) throws IOException { > meta = new HTable(conf, ".META."); > } > public boolean processRow(Result rowResult) throws IOException { > String r = new String(rowResult.getRow()); > if (r.startsWith("webtable,")) { > meta.delete(new Delete(rowResult.getRow())); > System.out.println("Deleting row " + rowResult); > } > return true; > } > } > public static void main(String[] args) throws Exception { > String tname = ".META."; > Configuration conf = HBaseConfiguration.create(); > MetaScanner.metaScan(conf, new Cleaner(conf), > Bytes.toBytes("webtable")); > } > } > {code} > I suggest to move this into HBaseFsck. I do not like personally to have these JRuby scripts floating around that may or may not help. This should be available if a user gets stuck and knows what he is doing (they can delete from .META. anyways). Maybe a "\-\-disable-table \-\-force" or so? But since disable is already in the shell we could add an "\-\-force" there? Or add a "\-\-delete-table " to the hbck? -- 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