Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 843BC200C16 for ; Thu, 9 Feb 2017 23:28:57 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 813F9160B50; Thu, 9 Feb 2017 22:28:57 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id AE3E5160B4B for ; Thu, 9 Feb 2017 23:28:56 +0100 (CET) Received: (qmail 82860 invoked by uid 500); 9 Feb 2017 22:28:55 -0000 Mailing-List: contact user-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hbase.apache.org Delivered-To: mailing list user@hbase.apache.org Received: (qmail 82848 invoked by uid 99); 9 Feb 2017 22:28:55 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Feb 2017 22:28:55 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id AAE0AC028C for ; Thu, 9 Feb 2017 22:28:54 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.698 X-Spam-Level: * X-Spam-Status: No, score=1.698 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id DtW0Ns0Kb-ar for ; Thu, 9 Feb 2017 22:28:51 +0000 (UTC) Received: from mail-yb0-f171.google.com (mail-yb0-f171.google.com [209.85.213.171]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id EB6115FABF for ; Thu, 9 Feb 2017 22:28:50 +0000 (UTC) Received: by mail-yb0-f171.google.com with SMTP id w194so5995922ybe.0 for ; Thu, 09 Feb 2017 14:28:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=VRI4vo/LvGzOY61jmmUAtwyVx9j8kYEwopHXsLNQvuQ=; b=pI4RxMOB3vYkb1mIAqg1Wtt5aF2Yjyj8GWq5g9jvb0+0YSBvI4ZqPUDSvvD45xHMvz COAlNRZeKMMkCK/+G7QZRiLWTuiE8yEX7wjPmwrL0LYty+S2BDYy8l9ZrOxjKm/vtAtw 6Lsfd0AjGVOtXdOwBaGybpr9PoxMaleA0yEO5Bwgby9af4D/SBXFcELFfgdshiN8eZLu OU/+OlEzXt9hsl17/z3RJWfygbJAHIW3upTiJjvT/lprdbxQCuqBbd8Z3njxNmBm+WEr 0RP9SjJN78e0BbNxnBzgDd7nFFncL6/KFMR1CdIpKkT/K2AI7OOgEFmAypBbu1ljGwjh 1BKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=VRI4vo/LvGzOY61jmmUAtwyVx9j8kYEwopHXsLNQvuQ=; b=l5cJMVALQ9giYtVh/C7TZ0oQ+TG2dX+2sOr6OD11E4jvnDqoclAe4Qwxl7VA3E/OTu umVVUp77ENo43tVz6hdcUsu44Q+2fdX5tJuTHo4aZCkRGDDsi1yED1euN65CAjtWC3yr hRBV3wB0IvlToVM3MOgyQYZFqj7/7lXZuFdlX5yKhHe58yUqxbzHQuh65cy03UZDNiXF TD5uz82RTrFgCd9sKeLY/eLQl38231wLCuBrZYVFWFUJDzJG4c2XH6gV9Q+On87gGt3J /2FaddNBtRAB3rD+mwFziXHjYm/0xJ/H8oQo21ZAJjoVi27KGtLOY5avlhTI1JpU/Zl6 9gMg== X-Gm-Message-State: AMke39nW1ZKvI5D+6nK5ab2ZMcxwsT3D1WEh+7NTb0M5du8z8r72vlfzbW45Ph6rA8eTKh4tlES0d9RxbFB+Kw== X-Received: by 10.37.170.166 with SMTP id t35mr4038932ybi.86.1486679329796; Thu, 09 Feb 2017 14:28:49 -0800 (PST) MIME-Version: 1.0 Received: by 10.37.170.104 with HTTP; Thu, 9 Feb 2017 14:28:49 -0800 (PST) In-Reply-To: References: <5894EDAA.6040904@apache.org> <5894F24B.5030008@apache.org> <589CC847.1060809@apache.org> From: Ted Yu Date: Thu, 9 Feb 2017 14:28:49 -0800 Message-ID: Subject: Re: Dropping a very large table - 75million rows To: "user@hbase.apache.org" Content-Type: multipart/alternative; boundary=94eb2c1882d858fa0a0548208108 archived-at: Thu, 09 Feb 2017 22:28:57 -0000 --94eb2c1882d858fa0a0548208108 Content-Type: text/plain; charset=UTF-8 bq. After the drop, the new table's regions showed a large drop in locality. Close to 1700 regions were dropped, please check master log for the duration table was dropped to see how many regions (of the other tables) were moved. Region movement might result in drop in locality. In StochasticLoadBalancer, there is LocalityCostFunction where: private static final String LOCALITY_COST_KEY = "hbase.master.balancer.stochastic.localityCost"; private static final float DEFAULT_LOCALITY_COST = 25; The default weight is very low, compared to region count weight (500). If you want balancer to favor locality when moving regions, please give the above config higher weight (on same level as 500). Cheers On Thu, Feb 9, 2017 at 2:17 PM, Ganesh Viswanathan wrote: > Thanks Ted/Josh. > > Ted- > I store historical metrics on the locality of regions in each regionserver > in the cluster. I noticed that the old table had many regions with low > locality before the drop while the other newer tables had very few cases of > low locality. After the drop, the new table's regions showed a large drop > in locality. > > Josh- > I did go from 2200regions before the drop to about 540regions. So, > relatively speaking, yes it could be that the old table had more regions > with overall higher locality (though it showed up as more regions in each > regionserver with lower locality). > > At what point (in terms of put/get load and row count/storage size in > HBase), does it make sense to dive into the data-locality settings and try > to tune it so that compaction and locality changes are more predictable? > Would looking at how to create regions (instead of auto-sharding) provide > greater benefit? > > Thanks! > Ganesh > > > On Thu, Feb 9, 2017 at 11:51 AM, Josh Elser wrote: > > > It could be that the table you dropped had a very good locality while the > > other tables had less. So, your overall locality went down (when the > "good" > > locality regions were no longer included). This wouldn't have affected > your > > system's performance because the locality for the table didn't change -- > > just the system-wide locality. > > > > > > Ted Yu wrote: > > > >> bq. The locality of regions for OTHER tables on the same regionserver > also > >> fell drastically > >> > >> Can you be a bit more specific on how you came to the above conclusion ? > >> Dropping one table shouldn't affect locality of other tables - unless > >> number of regions on each server becomes unbalanced which triggers > >> balancer > >> activities. > >> > >> Thanks > >> > >> On Thu, Feb 9, 2017 at 7:34 AM, Ganesh Viswanathan > >> wrote: > >> > >> So here is what I observed. > >>> Dropping this large table had an immediate effect on average locality > for > >>> the entire cluster. The locality of regions for OTHER tables on the > same > >>> regionserver also fell drastically in the cluster. This was unexpected > (I > >>> only thought locality of regions for the dropped table would be > >>> impacted). > >>> Is this because of compaction? Does the locality computation use the > size > >>> of other regions on each regionserver? > >>> > >>> The large drop in locality, however, did not cause latency issues on > read > >>> writes for the other tables. Why is that? Is it because I did not try > to > >>> hit all low locality regions? > >>> > >>> (On another note, I was able to test and perform deletions on per > region > >>> basis, but that requires hbck -repair and it seemed more invasive on > the > >>> entire cluster health.) > >>> > >>> Thanks, > >>> Ganesh > >>> > >>> > >>> On Sat, Feb 4, 2017 at 11:20 AM Josh Elser wrote: > >>> > >>> Ganesh, > >>>> > >>>> Just drop the table. You are worried about nothing. > >>>> > >>>> On Feb 3, 2017 16:51, "Ganesh Viswanathan" wrote: > >>>> > >>>> Hello Josh- > >>>>> > >>>>> I am trying to delete the entire table and recover the disk space. I > do > >>>>> > >>>> not > >>>> > >>>>> need to pick specific contents of the table (if thats what you are > >>>>> > >>>> asking > >>> > >>>> with #2). > >>>>> My question is would disabling and dropping such a large table affect > >>>>> > >>>> data > >>>> > >>>>> locality in a bad way, or slow down the cluster when major_compaction > >>>>> > >>>> (or > >>> > >>>> whatever cleans up the tombstoned rows) happens. I also read from > >>>>> > >>>> another > >>> > >>>> post that it can spawn zookeeper transactions and even lock the > >>>>> > >>>> zookeeper > >>> > >>>> nodes. Is there any concern around zookeeper functionality when > >>>>> > >>>> dropping > >>> > >>>> large HBase tables. > >>>>> > >>>>> Thanks again for taking the time to respond to my questions! > >>>>> > >>>>> Ganesh > >>>>> > >>>>> > >>>>> > >>>>> On Fri, Feb 3, 2017 at 1:12 PM, Josh Elser > wrote: > >>>>> > >>>>> Ganesh -- I was trying to get at maybe there is a terminology issue > >>>>>> > >>>>> here. > >>>> > >>>>> If you disable+drop the table, this is an operation on the order of > >>>>>> > >>>>> Regions > >>>>> > >>>>>> you have. The number of rows/entries is irrelevant. Closing and > >>>>>> > >>>>> deleting > >>>> > >>>>> a > >>>>> > >>>>>> region is a relatively fast operation. > >>>>>> > >>>>>> Can you please confirm: are you trying to delete the entire table or > >>>>>> > >>>>> are > >>>> > >>>>> you trying to delete the *contents* of a table? > >>>>>> > >>>>>> If it is the former, I stand by my "you're worried about nothing" > >>>>>> > >>>>> comment > >>>> > >>>>> :) > >>>>>> > >>>>>> > >>>>>> Ganesh Viswanathan wrote: > >>>>>> > >>>>>> Thanks Josh. > >>>>>>> > >>>>>>> Also, I realized I didnt give the full size of the table. It takes > >>>>>>> > >>>>>> in > >>> > >>>> ~75million rows per minute and stores for 15days. So around > >>>>>>> > >>>>>> 1.125billion > >>>> > >>>>> rows total. > >>>>>>> > >>>>>>> On Fri, Feb 3, 2017 at 12:52 PM, Josh Elser > >>>>>>> > >>>>>> wrote: > >>>> > >>>>> I think you are worried about nothing, Ganesh. > >>>>>>> > >>>>>>>> If you want to drop (delete) the entire table, just disable and > >>>>>>>> > >>>>>>> drop > >>> > >>>> it > >>>> > >>>>> from the shell. This operation is not going to have a significant > >>>>>>>> > >>>>>>> impact > >>>>> > >>>>>> on > >>>>>>>> your cluster (save a few flush'es). This would only happen if you > >>>>>>>> > >>>>>>> have > >>>> > >>>>> had > >>>>>>>> recent writes to this table (which seems unlikely if you want to > >>>>>>>> > >>>>>>> drop > >>> > >>>> it). > >>>>>>>> > >>>>>>>> > >>>>>>>> Ganesh Viswanathan wrote: > >>>>>>>> > >>>>>>>> Hello, > >>>>>>>> > >>>>>>>>> I need to drop an old HBase table that is quite large. It has > >>>>>>>>> > >>>>>>>> anywhere > >>>> > >>>>> between 2million and 70million datapoints. I turned off the count > >>>>>>>>> > >>>>>>>> after > >>>>> > >>>>>> it > >>>>>>>>> ran on the HBase shell for half a day. I have 4 other tables that > >>>>>>>>> > >>>>>>>> have > >>>> > >>>>> around 75million rows in total and also take heavy PUT and GET > >>>>>>>>> > >>>>>>>> traffic. > >>>>> > >>>>>> What is the best practice for disabling and dropping such a large > >>>>>>>>> > >>>>>>>> table > >>>>> > >>>>>> in > >>>>>>>>> HBase so that I have minimal impact on the rest of the cluster? > >>>>>>>>> 1) I hear there are ways to disable (and drop?) specific regions? > >>>>>>>>> > >>>>>>>> Would > >>>>> > >>>>>> that work? > >>>>>>>>> 2) Should I scan and delete a few rows at a time until the size > >>>>>>>>> > >>>>>>>> becomes > >>>>> > >>>>>> manageable and then disable/drop the table? > >>>>>>>>> If so, what is a good number of rows to delete at a time, > >>>>>>>>> > >>>>>>>> should I > >>>> > >>>>> run > >>>>>>>>> a > >>>>>>>>> major compaction after these row deletes on specific regions, and > >>>>>>>>> > >>>>>>>> what > >>>> > >>>>> is > >>>>>>>>> a > >>>>>>>>> good sized table that can be easily dropped (and has been > >>>>>>>>> > >>>>>>>> validated) > >>> > >>>> without causing issues on the larger cluster. > >>>>>>>>> > >>>>>>>>> > >>>>>>>>> Thanks! > >>>>>>>>> Ganesh > >>>>>>>>> > >>>>>>>>> > >>>>>>>>> > >>>>>>>>> > >> > --94eb2c1882d858fa0a0548208108--