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 53D7C200BD2 for ; Sat, 19 Nov 2016 02:19:13 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 52740160B16; Sat, 19 Nov 2016 01:19:13 +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 73571160B04 for ; Sat, 19 Nov 2016 02:19:12 +0100 (CET) Received: (qmail 86918 invoked by uid 500); 19 Nov 2016 01:19:06 -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 86896 invoked by uid 99); 19 Nov 2016 01:19:05 -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; Sat, 19 Nov 2016 01:19:05 +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 62C75C088D for ; Sat, 19 Nov 2016 01:19:05 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.631 X-Spam-Level: ** X-Spam-Status: No, score=2.631 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, HTML_OBFUSCATE_05_10=0.001, KAM_LOTSOFHASH=0.25, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, 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-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 4r61Ek9diWA3 for ; Sat, 19 Nov 2016 01:19:03 +0000 (UTC) Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 84C1D5F1E5 for ; Sat, 19 Nov 2016 01:19:02 +0000 (UTC) Received: by mail-wm0-f43.google.com with SMTP id t79so68571033wmt.0 for ; Fri, 18 Nov 2016 17:19:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=Yvs7PwO0sDKJERXL6n9L1gTJNeTpmntxewwcZr6B9Kc=; b=Pl1xmmur0U3da5xV2FyM6iAKfgi4qnjCD/FSMK+x6KblttLdURjggFRMDQCzx1CbXl 0H4dFQAhxAOCuUu57KbsSRqq+zqpS/oZ17Z06FSWVF8FZgi8v8KwVNrhBVgl7U6NdnPE TfTC+SYr+Kr4GxtLXYX0TjQDAo0lF4CUzh6wz7C2Fqoq7m3Rvs6CnfIMAXvHD/H3n3NB DD4q6xq/MjkXDLeeDl/ZTGMWrB4dHqxexkKKelYPfKgiAZuxy85NoKlLwhzRAw3vAHrU jJ8NQNdnBXhegWi0qOpNIIfFhmrIyFTZnLNAQZrRC5BtsB87gNA23zO44RlI+TL2gedz whsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=Yvs7PwO0sDKJERXL6n9L1gTJNeTpmntxewwcZr6B9Kc=; b=DO1M01OPMsJkUDgJNpUF3RdfmV5q/Vgz6GahrLxyFJPAyNf7kkAL5YraZaa1NsUQxU VPcQ8+ORLXeS1i0p0FA/NpT/8+yE2WHsMDN8hvkRlr2H+Cj2uWnhQTpUYL3AdAcR+olt e/k+JizBL44rmTo2UsRTuuy3MJGFqPBIptto4ELPjNpp7tFkZsvl8zQ72lwhAvLc9psN Qn80n4UepaHAP95fipsikH95AzOt2+kLWem+wQnp5XF/1HrMhSqZcoFvG58VtlqfxV2c ojIlh+3wxTkTKgqmJPCk1JxERA3cM1R1FGkMR/ICUqY2ehBpCmSAOfw6HdxAgMjTPYRb Yylg== X-Gm-Message-State: AKaTC00cBIg1lrReJ4lY6xjAG5NIJcPZHehB7MqHjA2MoTDATyjvdsy/hfoW+vQyy4xPCLlm+PARPTOkZhPtGA== X-Received: by 10.194.189.198 with SMTP id gk6mr1460642wjc.167.1479518341651; Fri, 18 Nov 2016 17:19:01 -0800 (PST) MIME-Version: 1.0 Received: by 10.28.169.7 with HTTP; Fri, 18 Nov 2016 17:18:40 -0800 (PST) In-Reply-To: References: From: Nick Dimiduk Date: Fri, 18 Nov 2016 17:18:40 -0800 Message-ID: Subject: Re: Why hbase doesn't remove the empty region To: hbase-dev Content-Type: multipart/alternative; boundary=047d7bb70e2e3164d005419d35c4 archived-at: Sat, 19 Nov 2016 01:19:13 -0000 --047d7bb70e2e3164d005419d35c4 Content-Type: text/plain; charset=UTF-8 HBase will not remove empty regions. It assumes you know what you're doing. In 1.2 there's a new "Region Normalizer" [0] feature that runs in the Master, which acts a bit like the Balancer, but for region sizes. I think it's still considered experimental, so YMMV. We're still on 1.1, so I haven't tried it in prod yet. I also have this problem in our cluster, because of a combination of TTL and Phoenix's Rowkey Timestamp feature. This results in region boundaries including the timestamp, and data that goes away after a period. Eventually all regions will become empty. I have a script that runs periodically to calculate region sizes and drop empty regions. I volunteered to contribute it [1], but haven't pulled it out of our puppet infra in the form of a patch. Let me revive that thread internally. -n [0]: https://issues.apache.org/jira/browse/HBASE-13103 [1]: https://issues.apache.org/jira/browse/HBASE-15712 On Fri, Nov 18, 2016 at 4:59 PM, Xi Yang wrote: > Yes, we're still on old release of 0.98.x > > Many of empty region didn't be deleted. Take one for example: > > > > "Namespace_default_table_java_app_logs_region_ > 29d4fa5482d17daf813e12732155e0ee_metric_storeCount" > > : 1, > > > > "Namespace_default_table_java_app_logs_region_ > 29d4fa5482d17daf813e12732155e0ee_metric_storeFileCount" > > : 1, > > > > "Namespace_default_table_java_app_logs_region_ > 29d4fa5482d17daf813e12732155e0ee_metric_memStoreSize" > > : 424, > > > > "Namespace_default_table_java_app_logs_region_ > 29d4fa5482d17daf813e12732155e0ee_metric_storeFileSize" > > : 549, > > > > "Namespace_default_table_java_app_logs_region_ > 29d4fa5482d17daf813e12732155e0ee_metric_compactionsCompletedCount" > > : 4, > > > > "Namespace_default_table_java_app_logs_region_ > 29d4fa5482d17daf813e12732155e0ee_metric_numBytesCompactedCount" > > : 8616506268, > > > > "Namespace_default_table_java_app_logs_region_ > 29d4fa5482d17daf813e12732155e0ee_metric_numFilesCompactedCount" > > : 4, > > > The log about last time major compaction of this region is: > > 2016-11-03 22:45:33,453 INFO org.apache.hadoop.hbase.regionserver.HStore: > > Completed major compaction of 1 (all) file(s) in log of > > java_app_logs,CM-sjcmhpcapp01-1476076988799-135168375- > 178aebc1-4bfc-47c4-907f-952f50270f50-b,1476360804449. > 29d4fa5482d17daf813e12732155e0ee. > > into 47b8ee796fc74ff0b82222bf60318f99(size=549), total size for store is > > 549. This selection was in queue for 0sec, and took 0sec to execute. > > 2016-11-03 22:45:33,454 INFO > > org.apache.hadoop.hbase.regionserver.CompactSplitThread: Completed > > compaction: Request = > > regionName=java_app_logs,CM-sjcmhpcapp01-1476076988799- > 135168375-178aebc1-4bfc-47c4-907f-952f50270f50-b,1476360804449. > 29d4fa5482d17daf813e12732155e0ee., > > storeName=log, fileCount=1, fileSize=1.3 G, priority=9, > > time=25652433393376299; duration=0sec > > > You can find that its size is only 549 bytes at that time. But HBase didn't > remove it. > > Here is the result I run HFile tool > > $ hbase org.apache.hadoop.hbase.io.hfile.HFile -v -f > > hdfs://xxxxxxx:8020/hbase/data/default/java_app_logs/ > 29d4fa5482d17daf813e12732155e0ee/log/47b8ee796fc74ff0b82222bf60318f99 > > 16/11/18 16:48:25 INFO Configuration.deprecation: hadoop.native.lib is > > deprecated. Instead, use io.native.lib.available > > 16/11/18 16:48:29 INFO Configuration.deprecation: fs.default.name is > > deprecated. Instead, use fs.defaultFS > > Scanning -> > > hdfs://xxxxxxx:8020/hbase/data/default/java_app_logs/ > 29d4fa5482d17daf813e12732155e0ee/log/47b8ee796fc74ff0b82222bf60318f99 > > 16/11/18 16:48:29 INFO hfile.CacheConfig: CacheConfig:disabled > > Scanned kv count -> 0 > > > > 2016-11-17 18:45 GMT-08:00 Ted Yu : > > > You would be able to find in region server log(s). > > > > Can you do quick inspection of the hfiles using: > > > > http://hbase.apache.org/book.html#hfile_tool > > > > BTW you're still on old release of 0.98.x, right ? > > > > On Thu, Nov 17, 2016 at 6:40 PM, Xi Yang wrote: > > > > > Thank you for reply. > > > > > > Yes. There are many regions have this problem. And those regions were > > > created several years ago. > > > hbase.hregion.majorcompaction of our cluster is 7 days. > > > Where can I see the last major compaction time? > > > > > > Thanks, > > > Alex > > > > > > 2016-11-17 18:22 GMT-08:00 Ted Yu : > > > > > > > When was the last time major compaction was performed on this region > ? > > > > > > > > Were you referring to the store files by 'them' in your question ? > > > > > > > > Cheers > > > > > > > > On Thu, Nov 17, 2016 at 6:18 PM, Xi Yang > > wrote: > > > > > > > > > I have some regions are empty. But HBase doesn't remove them, why? > > > > > > > > > > You can see the storeFileSize is only 549. But I use hbase shell to > > > scan > > > > > this region, the result is empty > > > > > > > > > > "Namespace_default_table_java_app_logs_region_ > > > > > 3854912733f1acaaa8a255abd6b7b1ec_metric_storeFileCount" > > > > > : 1, > > > > > "Namespace_default_table_java_app_logs_region_ > > > > > 3854912733f1acaaa8a255abd6b7b1ec_metric_memStoreSize" > > > > > : 424, > > > > > "Namespace_default_table_java_app_logs_region_ > > > > > 3854912733f1acaaa8a255abd6b7b1ec_metric_storeFileSize" > > > > > : 549, > > > > > "Namespace_default_table_java_app_logs_region_ > > > > > 3854912733f1acaaa8a255abd6b7b1ec_metric_compactionsCompletedCount" > > > > > : 4, > > > > > "Namespace_default_table_java_app_logs_region_ > > > > > 3854912733f1acaaa8a255abd6b7b1ec_metric_numBytesCompactedCount" > > > > > : 8503271111, > > > > > "Namespace_default_table_java_app_logs_region_ > > > > > 3854912733f1acaaa8a255abd6b7b1ec_metric_numFilesCompactedCount" > > > > > : 4, > > > > > > > > > > > > > > > --047d7bb70e2e3164d005419d35c4--