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 1077B200BDA for ; Tue, 29 Nov 2016 00:39:00 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 0F48E160B26; Mon, 28 Nov 2016 23:39:00 +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 612F7160B0D for ; Tue, 29 Nov 2016 00:38:59 +0100 (CET) Received: (qmail 67381 invoked by uid 500); 28 Nov 2016 23:38:58 -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 67360 invoked by uid 99); 28 Nov 2016 23:38:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Nov 2016 23:38:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 750E72C03DF for ; Mon, 28 Nov 2016 23:38:58 +0000 (UTC) Date: Mon, 28 Nov 2016 23:38:58 +0000 (UTC) From: "Guanghao Zhang (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-17140) Throw RegionOfflineException directly when request for a disabled table MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 28 Nov 2016 23:39:00 -0000 [ https://issues.apache.org/jira/browse/HBASE-17140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15703573#comment-15703573 ] Guanghao Zhang commented on HBASE-17140: ---------------------------------------- This patch's other goal is to reduce the meta request number. The prepare method in RegionServerCallable shows that all retry request will get table state first. For not disabled table's retry request, it will first get table state, then locate region and request twice to meta. See HBASE-6914 for more details. > Throw RegionOfflineException directly when request for a disabled table > ----------------------------------------------------------------------- > > Key: HBASE-17140 > URL: https://issues.apache.org/jira/browse/HBASE-17140 > Project: HBase > Issue Type: Improvement > Components: Client > Reporter: Guanghao Zhang > Assignee: Guanghao Zhang > Attachments: HBASE-17140-v1.patch, HBASE-17140-v2.patch, HBASE-17140-v3.patch, HBASE-17140-v4.patch, HBASE-17140-v5.patch > > > Now when request for a disabled table, it need 3 rpc calls before fail. > 1. get region location > 2. send call to rs and get NotServeRegionException > 3. retry and check the table state, then throw TableNotEnabledException > The table state check is added for disabled table. But now the prepare method in RegionServerCallable shows that all retry request will get table state first. > {code} > public void prepare(final boolean reload) throws IOException { > // check table state if this is a retry > if (reload && !tableName.equals(TableName.META_TABLE_NAME) && > getConnection().isTableDisabled(tableName)) { > throw new TableNotEnabledException(tableName.getNameAsString() + " is disabled."); > } > try (RegionLocator regionLocator = connection.getRegionLocator(tableName)) { > this.location = regionLocator.getRegionLocation(row); > } > if (this.location == null) { > throw new IOException("Failed to find location, tableName=" + tableName + > ", row=" + Bytes.toString(row) + ", reload=" + reload); > } > setStubByServiceName(this.location.getServerName()); > } > {code} > An improvement is set the region offline in HRegionInfo. Then throw the RegionOfflineException when get region location. > Review board: https://reviews.apache.org/r/54071/ -- This message was sent by Atlassian JIRA (v6.3.4#6332)