Return-Path: X-Original-To: apmail-hbase-dev-archive@www.apache.org Delivered-To: apmail-hbase-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B3A1D17C33 for ; Tue, 21 Apr 2015 23:13:22 +0000 (UTC) Received: (qmail 2870 invoked by uid 500); 21 Apr 2015 23:13:22 -0000 Delivered-To: apmail-hbase-dev-archive@hbase.apache.org Received: (qmail 2788 invoked by uid 500); 21 Apr 2015 23:13:22 -0000 Mailing-List: contact dev-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list dev@hbase.apache.org Received: (qmail 2774 invoked by uid 99); 21 Apr 2015 23:13:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Apr 2015 23:13:21 +0000 X-ASF-Spam-Status: No, hits=3.4 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_REPLY,HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: message received from 54.191.145.13 which is an MX secondary for dev@hbase.apache.org) Received: from [54.191.145.13] (HELO mx1-us-west.apache.org) (54.191.145.13) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Apr 2015 23:13:16 +0000 Received: from mail-qc0-f174.google.com (mail-qc0-f174.google.com [209.85.216.174]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id D4C07252FC for ; Tue, 21 Apr 2015 23:12:56 +0000 (UTC) Received: by qcyk17 with SMTP id k17so84573860qcy.1 for ; Tue, 21 Apr 2015 16:12:11 -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 :cc:content-type; bh=RcdTc7IZbiqECiKrYfZMh7hxPz6Md/EZTo0ed8Q4hgw=; b=r7593VeUaAtbvs5hGjPz0uAHiiBaYIwir2VjCLZmhij+7719aUzznM1OwZQnYvtcdY DRfVZ4uiTjzCUiM2Qyj4Jc5sETJ3IScxyfumngDia/iYFStmb8zkQFPxofR1lK3SYRFR ry5E+gCysjwU8Nr7ryr0U9YbSbbWnWpY72wOOBlGFrdsZ1/YLpm7bbC09xHhl568JGTV vxdvXZYjHkcEwsBhmhBUu6iV4/G00MiE8xM5pkRIJuKioShb6l1FwBgVaFqKiCBN8Gyk acuVJR3rSXmqj0Wq/UoaZ+0ZAcEm+XrA3Ttp8cBkgAc1jex/r3QefyE7YUcyTYp4SCKy YaeA== MIME-Version: 1.0 X-Received: by 10.55.55.72 with SMTP id e69mr43500211qka.78.1429657930964; Tue, 21 Apr 2015 16:12:10 -0700 (PDT) Received: by 10.229.181.65 with HTTP; Tue, 21 Apr 2015 16:12:10 -0700 (PDT) In-Reply-To: References: <201504212110335571577@sina.com> Date: Wed, 22 Apr 2015 07:12:10 +0800 Message-ID: Subject: Re: A compact bug? From: =?UTF-8?B?5byg6ZOO?= To: Ted Yu Cc: "dev@hbase.apache.org" , sershe Content-Type: multipart/alternative; boundary=001a114904682022090514442d37 X-Virus-Checked: Checked by ClamAV on apache.org --001a114904682022090514442d37 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable These code is wrapped by a 'if (this.compaction =3D=3D null)', so the code = will only be executed when selectNow =3D=3D false. 2015-04-21 22:49 GMT+08:00 Ted Yu : > In CompactionRunner#run(), we have: > > // Now see if we are in correct pool for the size; if not, go to > the correct one. > > // We might end up waiting for a while, so cancel the selection. > > assert this.compaction.hasSelection(); > > ThreadPoolExecutor pool =3D store.throttleCompaction( > > compaction.getRequest().getSize()) ? longCompactions : > shortCompactions; > > if (this.parent !=3D pool) { > > this.store.cancelRequestedCompaction(this.compaction); > > The above code would adjust to the correct pool, right ? > > > Cheers > > On Tue, Apr 21, 2015 at 7:10 AM, =E5=BC=A0=E9=93=8E wrote: > >> I think it is a bug. According to the comment above, they just want to >> put system compactions(selectNow =3D=3D false) to the small pool, so the= code >> should like this >> >> ThreadPoolExecutor pool; >> if (selectNow) { >> pool =3D s.throttleCompaction(compaction.getRequest().getSize()) >> ? longCompactions : shortCompactions; >> } else { >> pool =3D shortCompactions; >> } >> >> My code is on master so ignore the variable name differences... >> >> Would you mind open a issue on jira? >> >> Thanks. >> >> 2015-04-21 21:10 GMT+08:00 zhou_shuaifeng@sina.com < >> zhou_shuaifeng@sina.com>: >> >>> Hi all, >>> >>> In compactsplitthread.java, the requestCompactionInternal method is lik= e >>> this: >>> >>> private synchronized CompactionRequest requestCompactionInternal(fina= l >>> HRegion r, final Store s, >>> ... >>> >>> ThreadPoolExecutor pool =3D (!selectNow && s.throttleCompaction(siz= e)) >>> ? largeCompactions : smallCompactions; >>> >>> ... >>> >>> this will cause all compactions with selectNow =3Dtrue go to the small >>> compaction queue, even the size is large enough, is it reasonable? >>> >>> I checked the commit history, this comes from HBASE-8665, is there any >>> reason or a bug? >>> >>> thanks. >>> >>> >>> zhou_shuaifeng@sina.com >>> >> >> > --001a114904682022090514442d37--