Return-Path: X-Original-To: apmail-hbase-dev-archive@www.apache.org Delivered-To: apmail-hbase-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AB02710E9E for ; Mon, 16 Mar 2015 19:10:35 +0000 (UTC) Received: (qmail 66968 invoked by uid 500); 16 Mar 2015 19:10:35 -0000 Delivered-To: apmail-hbase-dev-archive@hbase.apache.org Received: (qmail 66889 invoked by uid 500); 16 Mar 2015 19:10:35 -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 66877 invoked by uid 99); 16 Mar 2015 19:10:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Mar 2015 19:10:34 +0000 X-ASF-Spam-Status: No, hits=2.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_REPLY,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of chrajeshbabu32@gmail.com designates 209.85.192.175 as permitted sender) Received: from [209.85.192.175] (HELO mail-pd0-f175.google.com) (209.85.192.175) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Mar 2015 19:10:29 +0000 Received: by pdbop1 with SMTP id op1so66118771pdb.2 for ; Mon, 16 Mar 2015 12:09:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=PY1kn2gGugQLQ/4eSNsNZpKY37U1Ypfi9Q83mVu+b5c=; b=GqNEeTWFudQFNBesTuCQAg2V5cn43B0sU1wcQt8J/8Sswec4RdVtlvUO4xnZeF5xWQ AlODxZGpLuzpXjERJQkHwq1r1yKa36JipbMDS78bbrm8iQ4y+2vM4o+R421c5M8TjZUu IG9PKv5hutIiDl2WcjnttiF7EhE7Js26BdC8teiGK+d6D1Dnddh8TspDrCdIRtL0T45P /GMWrcZpWosn7XIB/hwrH8K8QKjCrAdO/gEqtK528i6fyMy427fy4OWfGAIfCc75xomS zRtHK+bHaKCm2/zr3X9t4OfhxJ6LFa9R0WYh6OiX0+qbKc2j+4geFDub08EMNCVXBqBb c/Ag== MIME-Version: 1.0 X-Received: by 10.66.122.204 with SMTP id lu12mr80117234pab.52.1426532963752; Mon, 16 Mar 2015 12:09:23 -0700 (PDT) Received: by 10.66.246.168 with HTTP; Mon, 16 Mar 2015 12:09:23 -0700 (PDT) In-Reply-To: References: Date: Tue, 17 Mar 2015 00:39:23 +0530 Message-ID: Subject: Re: Question on EnableTableHandler code From: Rajeshbabu Chintaguntla To: "dev@hbase.apache.org" Content-Type: multipart/alternative; boundary=047d7bf0f4ec909ff205116c96d8 X-Virus-Checked: Checked by ClamAV on apache.org --047d7bf0f4ec909ff205116c96d8 Content-Type: text/plain; charset=UTF-8 Hi Stephen and Andrey, The first step added to remove stale znodes if table creation fails after znode creation. See HBASE-10215 . Not sure still we need it or not. Thanks, Rajeshbabu. On Tue, Mar 17, 2015 at 12:18 AM, Andrey Stepachev wrote: > Thanks Stephen. > > on (2): I think that much better to guarantee that table was enabled (i.e. > all internal structures reflect that fact and balancer knows about new > table). But result of that could be checked asyncronically from Admin. > Does it make sense? > > On Mon, Mar 16, 2015 at 6:10 PM, Stephen Jiang > wrote: > > > Andrey, I will take care of (1). > > > > And (2) :-) if your guys agree. Because it is not consistent, if the > bulk > > assigned failed, we would fail the enabling table; however, if the bulk > > assign not starts, we would enable table with offline regions - really > > inconsistent - we either all fail in those scenarios or all succeed with > > offline region (best effort approach). > > > > Thanks > > Stephen > > > > On Mon, Mar 16, 2015 at 11:01 AM, Andrey Stepachev > > wrote: > > > >> Stephen, would you like to create jira for case (1)? > >> > >> Thank you. > >> > >> On Mon, Mar 16, 2015 at 5:58 PM, Andrey Stepachev > >> wrote: > >> > >> > Thanks Stephen. > >> > > >> > Looks like you are right. For (1) case we really don't need there > >> > state cleanup. That is a bug. Should throw TableNotFoundException. > >> > > >> > As for (2) in case of no online region servers available we could > >> > leave table enabled, but no regions would be assigned. > >> > > >> > Actually that rises good question what enable table means, > >> > i.e. do we really need to guarantee that on table enable absolutely > >> > all regions are online, or that could be done in Admin on client side. > >> > > >> > So for now it seems that Enable handler do what is best, and leave > >> > table enabled but unassigned to be later assigned by Balancer. > >> > > >> > On Mon, Mar 16, 2015 at 5:34 PM, Stephen Jiang < > syuanjiangdev@gmail.com > >> > > >> > wrote: > >> > > >> >> I want to make sure that the following logic in EnableTableHandler is > >> >> correct: > >> >> > >> >> (1). In EnableTableHandler#prepare - if the table is not existed, it > >> >> marked > >> >> the table as deleted and not throw exception. The result is the > table > >> >> lock > >> >> is released and the caller has no knowledge that the table not exist > or > >> >> already deleted, it would continue the next step. > >> >> > >> >> Currently, this would happen during recovery (the caller is > >> >> AssignmentManager#recoverTableInEnablingState()) - however, looking > at > >> >> recovery code, it expects TableNotFoundException Should we always > >> throw > >> >> exception - if the table not exist? I want to make sure that I don't > >> >> break > >> >> recovery logic by modifying. > >> >> > >> >> public EnableTableHandler prepare() { > >> >> > >> >> ... > >> >> > >> >> // Check if table exists > >> >> > >> >> if (!MetaTableAccessor.tableExists(this.server.getConnection(), > >> >> tableName)) { > >> >> > >> >> // retainAssignment is true only during recovery. In normal > >> case > >> >> it is false > >> >> > >> >> if (!this.skipTableStateCheck) { > >> >> > >> >> throw new TableNotFoundException(tableName); > >> >> > >> >> } > >> >> > >> >> > this.assignmentManager.getTableStateManager().setDeletedTable( > >> >> tableName); > >> >> > >> >> } > >> >> > >> >> ... > >> >> > >> >> } > >> >> (2). In EnableTableHandler#handleEnableTable() - if the bulk assign > >> plan > >> >> could not be find, it would leave regions to be offline and declare > >> enable > >> >> table succeed - i think this is a bug and we should retry or fail - > >> but I > >> >> want to make sure that there are some merit behind this logic > >> >> > >> >> private void handleEnableTable() { > >> >> > >> >> Map> bulkPlan = > >> >> > >> >> this.assignmentManager.getBalancer().retainAssignment( > >> >> regionsToAssign, onlineServers); > >> >> > >> >> if (bulkPlan != null) { > >> >> > >> >> ... > >> >> > >> >> } else { > >> >> > >> >> LOG.info("Balancer was unable to find suitable servers for > table > >> " + > >> >> tableName > >> >> > >> >> + ", leaving unassigned"); > >> >> > >> >> done = true; > >> >> > >> >> } > >> >> > >> >> if (done) { > >> >> > >> >> // Flip the table to enabled. > >> >> > >> >> this.assignmentManager.getTableStateManager().setTableState( > >> >> > >> >> this.tableName, TableState.State.ENABLED); > >> >> > >> >> LOG.info("Table '" + this.tableName > >> >> > >> >> + "' was successfully enabled. Status: done=" + done); > >> >> > >> >> } > >> >> > >> >> ... > >> >> > >> >> } > >> >> > >> >> > >> >> thanks > >> >> Stephen > >> >> > >> > > >> > > >> > > >> > -- > >> > Andrey. > >> > > >> > >> > >> > >> -- > >> Andrey. > >> > > > > > > > -- > Andrey. > --047d7bf0f4ec909ff205116c96d8--