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 D3508200B68 for ; Fri, 19 Aug 2016 12:48:23 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id D1923160ABD; Fri, 19 Aug 2016 10:48:23 +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 F11DA160A8E for ; Fri, 19 Aug 2016 12:48:22 +0200 (CEST) Received: (qmail 70290 invoked by uid 500); 19 Aug 2016 10:48:22 -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 70275 invoked by uid 99); 19 Aug 2016 10:48:22 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Aug 2016 10:48:22 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id F03F22C014E for ; Fri, 19 Aug 2016 10:48:21 +0000 (UTC) Date: Fri, 19 Aug 2016 10:48:21 +0000 (UTC) From: "Guangxu Cheng (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HBASE-16430) RegionServer Group's bug when move tables MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 19 Aug 2016 10:48:24 -0000 [ https://issues.apache.org/jira/browse/HBASE-16430?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:all-tabpanel ] Guangxu Cheng updated HBASE-16430: ---------------------------------- Attachment: HBASE-16430-v2.patch > RegionServer Group's bug when move tables > ----------------------------------------- > > Key: HBASE-16430 > URL: https://issues.apache.org/jira/browse/HBASE-16430 > Project: HBase > Issue Type: Bug > Components: master > Affects Versions: 2.0.0 > Reporter: Guangxu Cheng > Fix For: 2.0.0 > > Attachments: HBASE-16430-v1.patch, HBASE-16430-v2.patch > > > It will be good when move one table at the same time.=20 > However,will appear abnormal when move two or more tables at once. > For example,move tableA and tableB from Group foo to Group bar: > {code} > hbase(main):001:0> get_rsgroup 'foo' > GROUP INFORMATION = = =20 > Servers: = = =20 > hbase-rs1:60020 = = =20 > Tables: = = =20 > tableA = = =20 > tableB = = =20 > 5 row(s) in 0.2800 seconds > hbase(main):002:0> get_rsgroup 'bar' > GROUP INFORMATION = = =20 > Servers: = = =20 > hbase-rs2:60020 = = =20 > Tables: = = =20 > 3 row(s) in 0.0050 seconds > hbase(main):003:0> move_rsgroup_tables 'bar',['tableA','tableB'] > hbase(main):004:0> get_rsgroup 'foo' > GROUP INFORMATION = = =20 > Servers: = = =20 > hbase-rs1:60020 = = =20 > Tables: = = =20 > tableB = = =20 > 4 row(s) in 0.0120 seconds > hbase(main):005:0> get_rsgroup 'bar' > GROUP INFORMATION = = =20 > Servers: = = =20 > hbase-rs2:60020 = = =20 > Tables: = = =20 > tableA = = =20 > tableB = = =20 > 5 row(s) in 0.0130 seconds > {code} > Now, you will be find tableB belongs to Group foo and Group bar. > Implementation of the moveTables as follows=EF=BC=9A > {code:title=3DRSGroupInfoManagerImpl.java|borderStyle=3Dsolid} > @Override > public synchronized void moveTables( > Set tableNames, String groupName) throws IOException { > if (groupName !=3D null && !rsGroupMap.containsKey(groupName)) { > throw new DoNotRetryIOException("Group "+groupName+" does not exist= or is a special group"); > } > Map newGroupMap =3D Maps.newHashMap(rsGroupMap); > for(TableName tableName: tableNames) { > if (tableMap.containsKey(tableName)) { > RSGroupInfo src =3D new RSGroupInfo(rsGroupMap.get(tableMap.get(t= ableName))); > src.removeTable(tableName); > newGroupMap.put(src.getName(), src); > } > if(groupName !=3D null) { > RSGroupInfo dst =3D new RSGroupInfo(newGroupMap.get(groupName)); > dst.addTable(tableName); > newGroupMap.put(dst.getName(), dst); > } > } > flushConfig(newGroupMap); > } > {code} > Should use newGroupMap instead of rsGroupMap: > {code} > RSGroupInfo src =3D new RSGroupInfo(rsGroupMap.get(tableMap.get(tableName= ))); > {code} > =3D=3D> > {code} > RSGroupInfo src =3D new RSGroupInfo(newGroupMap.get(tableMap.get(tableNam= e))); > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)