Return-Path: X-Original-To: apmail-hbase-issues-archive@www.apache.org Delivered-To: apmail-hbase-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3B10E18996 for ; Tue, 15 Mar 2016 06:16:34 +0000 (UTC) Received: (qmail 94365 invoked by uid 500); 15 Mar 2016 06:16:34 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 94257 invoked by uid 500); 15 Mar 2016 06:16:34 -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 94022 invoked by uid 99); 15 Mar 2016 06:16:33 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Mar 2016 06:16:33 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 848122C1F62 for ; Tue, 15 Mar 2016 06:16:33 +0000 (UTC) Date: Tue, 15 Mar 2016 06:16:33 +0000 (UTC) From: "Ashish Singhi (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-15433) SnapshotManager#restoreSnapshot not update table and region count quota correctly when encountering exception MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HBASE-15433?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15194785#comment-15194785 ] Ashish Singhi commented on HBASE-15433: --------------------------------------- Your idea sounds good to me. {quote} 4. clientA firstly reset the region count to 5, and then clientB reset the region count to 8, so the final region count for the table is 8 in such case, but it should be 5 because both operations failed. {quote} Just a another thought in my mind, instead of getting {{tableRegionCount}} value from quota cache can we get it from RegionLocator by this we can solve these problem. WDYT ? > SnapshotManager#restoreSnapshot not update table and region count quota correctly when encountering exception > ------------------------------------------------------------------------------------------------------------- > > Key: HBASE-15433 > URL: https://issues.apache.org/jira/browse/HBASE-15433 > Project: HBase > Issue Type: Bug > Components: snapshots > Affects Versions: 2.0.0 > Reporter: Jianwei Cui > Attachments: HBASE-15433-trunk-v1.patch, HBASE-15433-trunk-v2.patch, HBASE-15433-trunk.patch > > > In SnapshotManager#restoreSnapshot, the table and region quota will be checked and updated as: > {code} > try { > // Table already exist. Check and update the region quota for this table namespace > checkAndUpdateNamespaceRegionQuota(manifest, tableName); > restoreSnapshot(snapshot, snapshotTableDesc); > } catch (IOException e) { > this.master.getMasterQuotaManager().removeTableFromNamespaceQuota(tableName); > LOG.error("Exception occurred while restoring the snapshot " + snapshot.getName() > + " as table " + tableName.getNameAsString(), e); > throw e; > } > {code} > The 'checkAndUpdateNamespaceRegionQuota' will fail if regions in the snapshot make the region count quota exceeded, then, the table will be removed in the 'catch' block. This will make the current table count and region count decrease, following table creation or region split will succeed even if the actual quota is exceeded. -- This message was sent by Atlassian JIRA (v6.3.4#6332)