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 02BAB200CD7 for ; Mon, 17 Jul 2017 20:17:05 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 00F9216552C; Mon, 17 Jul 2017 18:17:05 +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 45CC4165539 for ; Mon, 17 Jul 2017 20:17:04 +0200 (CEST) Received: (qmail 56177 invoked by uid 500); 17 Jul 2017 18:17:03 -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 56158 invoked by uid 99); 17 Jul 2017 18:17:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Jul 2017 18:17:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id CD70BC0388 for ; Mon, 17 Jul 2017 18:17:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -96.202 X-Spam-Level: X-Spam-Status: No, score=-96.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_TIME=3, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id G4e9a59ao-65 for ; Mon, 17 Jul 2017 18:17:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 3DA1D5F64B for ; Mon, 17 Jul 2017 18:17:01 +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 81093E0D28 for ; Mon, 17 Jul 2017 18:17:00 +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 4098224761 for ; Mon, 17 Jul 2017 18:17:00 +0000 (UTC) Date: Mon, 17 Jul 2017 18:17:00 +0000 (UTC) From: "huaxiang sun (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (HBASE-18247) Hbck to fix the case that replica region shows as key in the meta table MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 17 Jul 2017 18:17:05 -0000 [ https://issues.apache.org/jira/browse/HBASE-18247?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16090208#comment-16090208 ] huaxiang sun edited comment on HBASE-18247 at 7/17/17 6:16 PM: --------------------------------------------------------------- I am able to manually create this situation and will post a patch with unittest shortly. was (Author: huaxiang): I am able to manually this situation and will post a patch with unittest shortly. > Hbck to fix the case that replica region shows as key in the meta table > ----------------------------------------------------------------------- > > Key: HBASE-18247 > URL: https://issues.apache.org/jira/browse/HBASE-18247 > Project: HBase > Issue Type: Bug > Affects Versions: 2.0.0-alpha-1 > Reporter: huaxiang sun > Assignee: huaxiang sun > Priority: Minor > > Recently, we run into one case with read replica, the replica region shows up as key in meta table (it is not supposed to happen, we are still working on why it showed up in the meta table). > However, hbck always reported the error about the primary region. Please see the error attached. > {code} > The entry in meta table > test,92b0201b,1492546349354_0001.c3e6f235fe7caef75f8b0fb92a012da3. column=info:regioninfo, timestamp=1494958820573, value={ENCODED => c3e6f235fe7caef75f8b0fb92a012da3, NAME => 'test,92b0201b,1492546349354_0001.c3e6f235fe7caef75f8b0fb92a012da3.', STARTKEY => '92b0201b', ENDKEY => '92f1a952', REPLICA_ID => 1} > ERROR: Region { meta => test,92b0201b,1492546349354.d2c637715f31a072f174e70d407fb458., hdfs => null, deployed => , replicaId => 0 } found in META, but not in HDFS or deployed on any region server. > {code} > Traced the code, in the following line, it does not consider the case that replicaId in regionInfo could be non-default. > https://github.com/apache/hbase/blob/master/hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java#L985 > If it is changed to get replicaId from regionInfo, then hbck should be able to fix this by "-fixMeta". > {code} > diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java > index 9eb5111..1649e53 100644 > --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java > +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java > @@ -982,7 +982,7 @@ public class MetaTableAccessor { > List locations = new ArrayList<>(1); > NavigableMap> familyMap = r.getNoVersionMap(); > > - locations.add(getRegionLocation(r, regionInfo, 0)); > + locations.add(getRegionLocation(r, regionInfo, regionInfo.getReplicaId())); > > NavigableMap infoMap = familyMap.get(getCatalogFamily()); > if (infoMap == null) return new RegionLocations(locations); > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)