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 92A73200CF4 for ; Sun, 3 Sep 2017 18:27:14 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 87D29162400; Sun, 3 Sep 2017 16:27:14 +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 CC0A31615D7 for ; Sun, 3 Sep 2017 18:27:13 +0200 (CEST) Received: (qmail 59171 invoked by uid 500); 3 Sep 2017 16:27:12 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 59160 invoked by uid 99); 3 Sep 2017 16:27:12 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 Sep 2017 16:27:12 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 7FAF61A0A8B for ; Sun, 3 Sep 2017 16:27:11 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id hWXp6pULa9ew for ; Sun, 3 Sep 2017 16:27:06 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 7A55F5FCB9 for ; Sun, 3 Sep 2017 16:27:06 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id B5BC1E0AF9 for ; Sun, 3 Sep 2017 16:27:04 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id AC5AE24153 for ; Sun, 3 Sep 2017 16:27:02 +0000 (UTC) Date: Sun, 3 Sep 2017 16:27:02 +0000 (UTC) From: "Ted Yu (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-18743) HFiles in use by a table which has the same name and namespace with a default table cloned from snapshot may be deleted when that snapshot and default table are deleted MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sun, 03 Sep 2017 16:27:14 -0000 [ https://issues.apache.org/jira/browse/HBASE-18743?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16151852#comment-16151852 ] Ted Yu commented on HBASE-18743: -------------------------------- Patch doesn't apply to branch-1 Please attach patch for branch-1 > HFiles in use by a table which has the same name and namespace with a default table cloned from snapshot may be deleted when that snapshot and default table are deleted > ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ > > Key: HBASE-18743 > URL: https://issues.apache.org/jira/browse/HBASE-18743 > Project: HBase > Issue Type: Bug > Components: hbase > Affects Versions: 1.1.12 > Reporter: wenbang > Assignee: wenbang > Priority: Critical > Fix For: 1.4.0, 1.3.2, 1.5.0, 1.2.7, 2.0.0-alpha-3 > > Attachments: HBASE_18743.patch, HBASE_18743_v1.patch, HBASE_18743_v2.patch > > > We recently had a critical production issue in which HFiles that were still in use by a table were deleted. > This appears to have been caused by conditions in which table have the same namespace and name with a default table cloned from snapshot.when snapshot and default table be deleted,HFiles that are still in use may be deleted. > For example: > Table with default namespace is: "t1" > The namespace of the new table is the same as the name of the default table, and is generated by snapshot cloned : "t1: t1" > When the snapshot and the default namespace table are deleted, the new table is also deleted in the used HFiles > This is because the creation of the BackReferenceFile get the table Name is not normal, resulting in can not find the reference file, hfilecleaner to delete the HFiles in used, when the table has not been major compact > {code:java} > public static boolean create(final Configuration conf, final FileSystem fs, > final Path dstFamilyPath, final TableName linkedTable, final String linkedRegion, > final String hfileName, final boolean createBackRef) throws IOException { > String familyName = dstFamilyPath.getName(); > String regionName = dstFamilyPath.getParent().getName(); > String tableName = FSUtils.getTableName(dstFamilyPath.getParent().getParent()) > .getNameAsString(); > {code} > {code:java} > public static TableName getTableName(Path tablePath) { > return TableName.valueOf(tablePath.getParent().getName(), tablePath.getName()); > } > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)