Return-Path: X-Original-To: apmail-hbase-user-archive@www.apache.org Delivered-To: apmail-hbase-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 89F4918F03 for ; Wed, 7 Oct 2015 20:34:12 +0000 (UTC) Received: (qmail 56118 invoked by uid 500); 7 Oct 2015 20:34:10 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 56045 invoked by uid 500); 7 Oct 2015 20:34:10 -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 56033 invoked by uid 99); 7 Oct 2015 20:34:10 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Oct 2015 20:34:10 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 077EAC432A for ; Wed, 7 Oct 2015 20:34:10 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.9 X-Spam-Level: ** X-Spam-Status: No, score=2.9 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 836jzpc3mlFN for ; Wed, 7 Oct 2015 20:34:03 +0000 (UTC) Received: from mail-yk0-f179.google.com (mail-yk0-f179.google.com [209.85.160.179]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id E6911204C9 for ; Wed, 7 Oct 2015 20:34:02 +0000 (UTC) Received: by ykdz138 with SMTP id z138so29952457ykd.2 for ; Wed, 07 Oct 2015 13:34:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=kBAWYgWz/DvstvN1YKWqTfIlvY1PG78WUTw3pB5vx98=; b=Q2+gcj+aQEgHFjCLYHUYjlKGcOyZho6LvZ6E/n+JmoqrVNmWrwEuG/H9tOfzNHgtT3 c4XTVOkivQxgYCFzr9gP2JVUsu3LCYQMjkYyzCXt2oHQT5jCoUZo//+AjtOjWeSaGexi czjbb8Q0jAbR5PV//tZdCoTw2AjIfNKuIyrub2CvVzisQeEzC0acXsOn58bcI1/LQHSp RJ4UAL5sMB46sIBfK0kp6avZebpbWLp85hocUCGTTpBOut3jhP1j8i8VmxyjsGDTHkM8 F0UJj/AZPTL094Xsxl0aLs/EmPVD+Y4jWMh8l1uvFtsWaw9CKVWA2dXjsk+48GwQsL5M PibQ== MIME-Version: 1.0 X-Received: by 10.129.146.201 with SMTP id j192mr2640362ywg.315.1444250041851; Wed, 07 Oct 2015 13:34:01 -0700 (PDT) Received: by 10.37.210.197 with HTTP; Wed, 7 Oct 2015 13:34:01 -0700 (PDT) In-Reply-To: <9680FF4F-6AA1-4016-8707-489CE209AC3E@connexity.com> References: <57258DD8-8440-4F2A-9D51-C1ADC28ED7A9@connexity.com> <9680FF4F-6AA1-4016-8707-489CE209AC3E@connexity.com> Date: Wed, 7 Oct 2015 13:34:01 -0700 Message-ID: Subject: Re: Minor compacts seem blocked on major compacts From: Ted Yu To: "user@hbase.apache.org" Content-Type: multipart/alternative; boundary=94eb2c0844aab627ae052189aaa3 --94eb2c0844aab627ae052189aaa3 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Have you seen the following code ? ThreadPoolExecutor pool =3D (selectNow && s.throttleCompaction(compaction.getRequest().getSize())) ? longCompactions : shortCompactions; Looks like throttleCompaction() returned false. Please see the following method in RatioBasedCompactionPolicy : public boolean throttleCompaction(long compactionSize) { return compactionSize > comConf.getThrottlePoint(); FYI On Wed, Oct 7, 2015 at 11:07 AM, Randy Fox wrote: > Looking at the source I don=E2=80=99t see how a manual major compact coul= d get in > the large compaction pool: > If selectNow Is True the pool selector has to be shortCompactions. From > the logs it sure seems that selectNow has to be true, else it would have > logged =E2=80=9Csystem=E2=80=9D instead of > "org.apache.hadoop.hbase.regionserver.DefaultStoreEngine$DefaultCompactio= nContext@7f236eb8 > ;=E2=80=9D > > > Sure seems like an hbase bug. > > Am I missing something? > > Thanks, > > Randy > > /** > * @param r HRegion store belongs to > * @param s Store to request compaction on > * @param why Why compaction requested -- used in debug messages > * @param priority override the default priority (NO_PRIORITY =3D=3D de= cide) > * @param request custom compaction request. Can be null in > which case a simple > * compaction will be used. > */ > private synchronized CompactionRequest requestCompactionInternal(final > HRegion r, final Store s, > final String why, int priority, CompactionRequest request, boolean > selectNow) > throws IOException { > if (this.server.isStopped() > || (r.getTableDesc() !=3D null && > !r.getTableDesc().isCompactionEnabled())) { > return null; > } > > CompactionContext compaction =3D null; > if (selectNow) { > compaction =3D selectCompaction(r, s, priority, request); > if (compaction =3D=3D null) return null; // message logged inside > } > > // We assume that most compactions are small. So, put system > compactions into small > // pool; we will do selection there, and move to large pool if > necessary. > long size =3D selectNow ? compaction.getRequest().getSize() : 0; > ThreadPoolExecutor pool =3D (!selectNow && s.throttleCompaction(size)= ) > ? longCompactions : shortCompactions; > pool.execute(new CompactionRunner(s, r, compaction, pool)); > if (LOG.isDebugEnabled()) { > String type =3D (pool =3D=3D shortCompactions) ? "Small " : "Large = "; > LOG.debug(type + "Compaction requested: " + (selectNow ? > compaction.toString() : "system") > + (why !=3D null && !why.isEmpty() ? "; Because: " + why : "") = + > "; " + this); > } > return selectNow ? compaction.getRequest() : null; > } > > > > > > On 10/6/15, 9:58 PM, "Randy Fox" wrote: > > >Sorry, I do not follow. I thought there was one thread per pool, one for > large and one for small. Thus my major compact should have been in the > large pool and not blocking the small pool. That is how it worked in 0.9= 4. > >From the logs it demoted my compact to the small pool. > > > >-randy > > > > > > > >On 10/6/15, 4:32 PM, "Vladimir Rodionov" wrote: > > > >>>> If I read this correct the size is 4.8G and the throttle is 2.5G so = it > >>should have been put into the Large compaction pool. > >> > >>You answered your question yourself. Minor compaction in the same pool = (1 > >>thread default) will be waiting until major is finished. > >> > >>-Vlad > >> > >> > >>On Tue, Oct 6, 2015 at 3:59 PM, Randy Fox wrote: > >> > >>> 2015-10-06 14:50:35,644 INFO > org.apache.hadoop.hbase.regionserver.HStore: > >>> Starting compaction of 4 file(s) in L of PROD_audience4,\x00 > >>> \xB6\x0B\xA7,\x186,1443751119137.26f321d7b240c85a9350a95f6c288e49. in= to > >>> > tmpdir=3Dhdfs://woz/hbase/data/default/PROD_audience4/26f321d7b240c85a935= 0a95f6c288e49/.tmp, > >>> totalSize=3D4.8 G > >>> 2015-10-06 14:50:35,646 DEBUG > >>> org.apache.hadoop.hbase.regionserver.CompactSplitThread: Small > Compaction > >>> requested: > >>> > org.apache.hadoop.hbase.regionserver.DefaultStoreEngine$DefaultCompaction= Context@7f236eb8 > ; > >>> Because: User-triggered major compaction; compaction_queue=3D(0:0), > >>> split_queue=3D0, merge_queue=3D0 > >>> > >>> > >>> If I read this correct the size is 4.8G and the throttle is 2.5G so i= t > >>> should have been put into the Large compaction pool. > >>> > >>> > >>> > >>> > >>> > >>> On 10/6/15, 3:07 PM, "Randy Fox" wrote: > >>> > >>> >We just did a big leap forward from 0.94 to 1.0. We do our own major > >>> compacts manually every night. One of the first things we noticed is > that > >>> when a major compact runs, no minors run. The compaction queue grows > and > >>> when the major compact finishes the minors then run. I have not > found any > >>> new knobs we should be setting. Any ideas? > >>> >Our config is: > >>> > > >>> > > >>> > hbase.hregion.majorcompaction > >>> > 0 > >>> > true > >>> > > >>> > > >>> > hbase.hstore.compactionThreshold > >>> > 3 > >>> > > >>> > > >>> > > >>> > hbase.hstore.compaction.max > >>> > 9 > >>> > > >>> > > >>> > hbase.regionserver.thread.compaction.throttle > >>> > 2684354560 > >>> > > >>> > > >>> > > >>> >Thanks in advance, > >>> > > >>> >Randy > >>> > --94eb2c0844aab627ae052189aaa3--