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 3A5FA200ACA for ; Thu, 9 Jun 2016 21:14:54 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 38EB4160A58; Thu, 9 Jun 2016 19:14:54 +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 3FD3D160A29 for ; Thu, 9 Jun 2016 21:14:53 +0200 (CEST) Received: (qmail 21059 invoked by uid 500); 9 Jun 2016 19:14:52 -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 21047 invoked by uid 99); 9 Jun 2016 19:14:51 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Jun 2016 19:14:51 +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 20E7EC07DB for ; Thu, 9 Jun 2016 19:14:51 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.28 X-Spam-Level: * X-Spam-Status: No, score=1.28 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id sPzWHZFgkgzH for ; Thu, 9 Jun 2016 19:14:49 +0000 (UTC) Received: from mail-oi0-f54.google.com (mail-oi0-f54.google.com [209.85.218.54]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with ESMTPS id 6FB345F642 for ; Thu, 9 Jun 2016 19:14:19 +0000 (UTC) Received: by mail-oi0-f54.google.com with SMTP id k23so79031091oih.0 for ; Thu, 09 Jun 2016 12:14:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to; bh=hDT7zD/TuxWs8YBKElyYWIGeNDqQNxoVOU32X1v5u18=; b=XWnuzJ4MGKqSNL4ERbd4YnQFyc32x9noskyCV5mPWs5DvOTwJZWHBFy5S04IIe+6wt xAGsG3oUqeqXFjGjVyTPcCb7QeBXa1bpYxth2AM1H+eRxyBr1tpuEV6QmQ2upPap49rh Q85vVYBo8D0IFd+QMQQJLxQNcUw5VVTecpODIN5hUnQDUWoGs0PvNPaX7mceyJLMKzOr mzFfCmGu1zKb6SGLJ3qKSk7mU9TF77EGVoIwpWUSHWJahTuU9+2IdtsCbh67s09CvLMq GU288H64KqgjVh7MgsSffpAjmSe4satHKsL9RMaIfO7+QCmnwWKPecwJYN5KQvaKWRlF uz7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to; bh=hDT7zD/TuxWs8YBKElyYWIGeNDqQNxoVOU32X1v5u18=; b=JBetR43v6GCx1vFMjG30e/TEjEQq6ix9yGlX3xajxXvX+KfYE5+oxOUqfJZim346SV Zeqn9zhUXsAGJZCiC1suRIASQ8dCujsmsmf6IJy0yFjs1xCyc60VBRAsRxIwkztauj9I DNg+UTRvsmPvDkyYEM9d8k7PkI5qk4FOgdoUdzX3gLHM5smFcPb8yZcGQp2XhnyxfOGx nGeDhlqewaqw/0XdvRxtVZ+OvrGqT8CJlRVYBGdHQVKIVfgqxZbS53E5W+HincaWpFt6 QiFlKLlUmElO8qJo/yj6Anu8Lmh99fLVVa6w09KRaDdhT8pwEuwxEbnd9I+s+ImbzZtw u/SA== X-Gm-Message-State: ALyK8tJY0Ns0H9ARoJUfqRxD6izYCUF9Ear0aQR+PQo1fdFUELARpG4E8UCiEUCMMQYVWEdIa/Y/3VT4lePzCA== X-Received: by 10.157.32.196 with SMTP id x62mr7179193ota.120.1465499304402; Thu, 09 Jun 2016 12:08:24 -0700 (PDT) MIME-Version: 1.0 Sender: saint.ack@gmail.com Received: by 10.182.122.99 with HTTP; Thu, 9 Jun 2016 12:08:23 -0700 (PDT) In-Reply-To: References: From: Stack Date: Thu, 9 Jun 2016 12:08:23 -0700 X-Google-Sender-Auth: MdzxVpTyfa_gJ0dwAYpFKXdE2K0 Message-ID: Subject: Re: Major compaction cannot remove deleted rows until the region is split. Strange! To: Hbase-User Content-Type: multipart/alternative; boundary=94eb2c11012075262c0534dd25da archived-at: Thu, 09 Jun 2016 19:14:54 -0000 --94eb2c11012075262c0534dd25da Content-Type: text/plain; charset=UTF-8 Tian-ying: Can you try the suggestion below to see if it helps? Do you see the lease expired logs? St.Ack On Thu, Jun 2, 2016 at 7:03 PM, hao zhang wrote: > Hi, Stack > > We found this in our production cluster, too. I take a look about the > code and found one case which will make the major compact not work. > > 1. put some rows > 2. scan > 3. delete > 4. scanner didn't close rightly, it will keep the the read point in > region's scannerReadPoints. > 5. major compact. It can't work because we have a scanner which have > small read point than the delete. > > But if move the region to new rs, the scannerReadPoints will update to > the biggest memstoreTs which form sotrefile. So major compact will work. > I thought the try...catch module in Scanner.leaseExpired() method needs a > finally module to close the region scanner rightly. > > public void leaseExpired() { > RegionScannerHolder rsh = scanners.remove(this.scannerName); > if (rsh != null) { > RegionScanner s = rsh.s; > LOG.info("Scanner " + this.scannerName + " lease expired on region > " > + s.getRegionInfo().getRegionNameAsString()); > try { > Region region = > regionServer.getRegion(s.getRegionInfo().getRegionName()); > if (region != null && region.getCoprocessorHost() != null) { > region.getCoprocessorHost().preScannerClose(s); > } > s.close(); > if (region != null && region.getCoprocessorHost() != null) { > region.getCoprocessorHost().postScannerClose(s); > } > } catch (IOException e) { > LOG.error("Closing scanner for " > + s.getRegionInfo().getRegionNameAsString(), e); > } > } else { > LOG.warn("Scanner " + this.scannerName + " lease expired, but no > related" + > " scanner found, hence no chance to close that related > scanner!"); > } > } > > > 2016-06-02 2:50 GMT+08:00 Stack : > > > On Wed, Jun 1, 2016 at 10:56 AM, Tianying Chang > wrote: > > > > > Hi, Stack > > > > > > After moving the region and issue a major compact on that region, its > > size > > > shrink from 99G down to 24G. So it looks like the region is in a bad > > state > > > that cannot recover, close/open it fixed the issue. And from the region > > > size metric graph, we can see major compaction stop working since > March > > > 31, so some bug that caused region enter into bad state... > Unfortunately, > > > we don't have DEBUG enabled and that is the last region that has the > > issue, > > > it is hard to figure out what is the bug that caused the bad state... > > > > > > > > Interesting. So moving it to another RS make it major-compactable? That > > would seem to indicate some state kept in the RS memory is preventing the > > major compaction running. Is moving the region a workaround for you until > > we figure what it is Tian-Ying? > > > > St. > > > > > > > > > Thanks > > > Tian-Ying > > > > > > On Tue, May 31, 2016 at 3:43 PM, Tianying Chang > > wrote: > > > > > > > Hi, Stack > > > > > > > > Based on the log, the major compaction was run, and it took 5+ hours. > > > And > > > > I also manually run major_compact from hbase shell explicitly to > > verify. > > > > > > > > I just moved the region to a different RS and issued a major_compact > on > > > > that region again, let me see if the major compaction can succeed and > > > will > > > > report back. > > > > > > > > Thanks > > > > Tian-Ying > > > > > > > > On Sun, May 29, 2016 at 4:35 PM, Stack wrote: > > > > > > > >> On Fri, May 27, 2016 at 3:17 PM, Tianying Chang > > > >> wrote: > > > >> > > > >> > Yes, it is 94.26. By a quick glance, I didn't see any put that > is > > > >> older > > > >> > than the delete marker's TS, which could go as far as about couple > > > weeks > > > >> > ago since major compaction on it for long time seems. > > > >> > > > > >> Also it is really strange that if the region is split, then seems > > > >> > everything is working as expected. Also we noticed, the same > region > > > >> > replicated at the slave side is totally normal, i.e. at 20+G.... > > > >> > > > > >> > > > > >> If you move the region to another server, does that work? > > > >> > > > >> Looking in 0.94 codebase, I see this in Compactor#compact > > > >> > > > >> > > > >> // For major compactions calculate the earliest put timestamp > > > >> > > > >> // of all involved storefiles. This is used to remove > > > >> > > > >> // family delete marker during the compaction. > > > >> > > > >> if (majorCompaction) { > > > >> > > > >> tmp = fileInfo.get(StoreFile.EARLIEST_PUT_TS); > > > >> > > > >> if (tmp == null) { > > > >> > > > >> // There's a file with no information, must be an old one > > > >> > > > >> // assume we have very old puts > > > >> > > > >> earliestPutTs = HConstants.OLDEST_TIMESTAMP; > > > >> > > > >> } else { > > > >> > > > >> earliestPutTs = Math.min(earliestPutTs, > Bytes.toLong(tmp)); > > > >> > > > >> } > > > >> > > > >> } > > > >> > > > >> > > > >> The above is followed by this log line: > > > >> > > > >> > > > >> if (LOG.isDebugEnabled()) { > > > >> > > > >> LOG.debug("Compacting " + file + > > > >> > > > >> ", keycount=" + keyCount + > > > >> > > > >> ", bloomtype=" + r.getBloomFilterType().toString() + > > > >> > > > >> ", size=" + StringUtils.humanReadableInt(r.length()) + > > > >> > > > >> ", encoding=" + r.getHFileReader().getEncodingOnDisk() + > > > >> > > > >> (majorCompaction? ", earliestPutTs=" + earliestPutTs: > "")); > > > >> > > > >> } > > > >> > > > >> This prints out earliestPutTs. You see that in the logs? You > running > > > with > > > >> DEBUG? Does the earliest put ts preclude our dropping delete family? > > > >> > > > >> > > > >> Looking more in code, we retain deletes in following circumstances: > > > >> > > > >> > > > >> this.retainDeletesInOutput = scanType == ScanType.MINOR_COMPACT > || > > > >> scan > > > >> .isRaw(); > > > >> > > > >> > > > >> So, for sure we are running major compaction? > > > >> > > > >> Otherwise, have to dig in a bit more here.. This stuff is a little > > > >> involved. > > > >> St.Ack > > > >> > > > >> > > > >> > > > >> > > > >> > On Fri, May 27, 2016 at 3:13 PM, Stack wrote: > > > >> > > > > >> > > On Fri, May 27, 2016 at 2:32 PM, Tianying Chang < > > tychang@gmail.com> > > > >> > wrote: > > > >> > > > > > >> > > > Hi, > > > >> > > > > > > >> > > > We saw a very strange case in one of our production cluster. A > > > >> couple > > > >> > > > regions cannot get their deleted rows or delete marker removed > > > even > > > >> > after > > > >> > > > major compaction. However when the region triggered split (we > > set > > > >> 100G > > > >> > > for > > > >> > > > auto split), the deletion worked. The 100G region becomes two > > 10G > > > >> > > daughter > > > >> > > > regions, and all the delete marker are gone. > > > >> > > > > > > >> > > > Also, the same region in the slave cluster (through > replication) > > > >> have > > > >> > > > normal size at about 20+G. > > > >> > > > > > > >> > > > BTW, the delete marker in the regions are mostly deleteFamily > if > > > it > > > >> > > > matters. > > > >> > > > > > > >> > > > This is really weird. Anyone has any clue for this strange > > > behavior? > > > >> > > > > > > >> > > > Thanks > > > >> > > > Tian-Ying > > > >> > > > > > > >> > > > These 0.94 Tian-Ying? > > > >> > > > > > >> > > It looks like the DeleteFamily is retained only; do you see > > > incidence > > > >> > where > > > >> > > there may have been versions older than the DeleteFamily that > are > > > also > > > >> > > retained post-major-compaction? > > > >> > > > > > >> > > St.Ack > > > >> > > > > > >> > > > > > >> > > > > > >> > > > A snippet of the HFile generated by the major compaction: > > > >> > > > > > > >> > > > : \xA0\x00\x00L\x1A@\x1CBe\x00\x00\x08m\x03\x1A@ > > > >> > > > \x10\x00?PF/d:/1459808114380/DeleteFamily/vlen=0/ts= > 2292870047 > > > >> > > > V: > > > >> > > > K: \xA0\x00\x00L\x1A@\x1CBe\x00\x00\x08m\x03\x1A@ > > > >> > > > \x10\x00?PF/d:/1459808114011/DeleteFamily/vlen=0/ts= > 2292869794 > > > >> > > > V: > > > >> > > > K: \xA0\x00\x00L\x1A@\x1CBe\x00\x00\x08m\x03\x1A@ > > > >> > > > \x10\x00?PF/d:/1459805381104/DeleteFamily/vlen=0/ts=2291072240 > > > >> > > > V: > > > >> > > > K: \xA0\x00\x00L\x1A@\x1CBe\x00\x00\x08m\x03\x1A@ > > > >> > > > \x10\x00?PF/d:/1459805380673/DeleteFamily/vlen=0/ts=2291071997 > > > >> > > > V: > > > >> > > > K: \xA0\x00\x00L\x1A@\x1CBe\x00\x00\x08m\x03\x1A@ > > > >> > > > \x10\x00?PF/d:/1459802643449/DeleteFamily/vlen=0/ts=2290248886 > > > >> > > > V: > > > >> > > > K: \xA0\x00\x00L\x1A@\x1CBe\x00\x00\x08m\x03\x1A@ > > > >> > > > \x10\x00?PF/d:/1459802643246/DeleteFamily/vlen=0/ts=2290248786 > > > >> > > > V: > > > >> > > > K: \xA0\x00\x00L\x1A@\x1CBe\x00\x00\x08m\x03\x1A@ > > > >> > > > \x10\x00?PF/d:/1459799913003/DeleteFamily/vlen=0/ts= > 2289446916 > > > >> > > > V: > > > >> > > > K: \xA0\x00\x00L\x1A@\x1CBe\x00\x00\x08m\x03\x1A@ > > > >> > > > \x10\x00?PF/d:/1459797181831/DeleteFamily/vlen=0/ts= > 2288670451 > > > >> > > > V: > > > >> > > > K: \xA0\x00\x00L\x1A@\x1CBe\x00\x00\x08m\x03\x1A@ > > > >> > > > \x10\x00?PF/d:/1459794447388/DeleteFamily/vlen=0/ts= > 2287911443 > > > >> > > > V: > > > >> > > > K: \xA0\x00\x00L\x1A@\x1CBe\x00\x00\x08m\x03\x1A@ > > > >> > > > \x10\x00?PF/d:/1459791708803/DeleteFamily/vlen=0/ts= > 2287213792 > > > >> > > > V: > > > >> > > > K: \xA0\x00\x00L\x1A@\x1CBe\x00\x00\x08m\x03\x1A@ > > > >> > > > \x10\x00?PF/d:/1459788978387/DeleteFamily/vlen=0/ts= > 2286488738 > > > >> > > > V: > > > >> > > > K: \xA0\x00\x00L\x1A@\x1CBe\x00\x00\x08m\x03\x1A@ > > > >> > > > \x10\x00?PF/d:/1459786243642/DeleteFamily/vlen=0/ts= > 2285778927 > > > >> > > > V: > > > >> > > > > > > >> > > > > > >> > > > > >> > > > > > > > > > > > > > > --94eb2c11012075262c0534dd25da--