hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "huaxiang sun (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-18247) Hbck to fix the case that replica region shows as key in the meta table
Date Thu, 20 Jul 2017 19:09:00 GMT

    [ https://issues.apache.org/jira/browse/HBASE-18247?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16095211#comment-16095211
] 

huaxiang sun commented on HBASE-18247:
--------------------------------------

I run the failed test cases locally with the patch, and it passed. [~tedyu@apache.org], could
you help to take a look at the patch? Thanks.

{code}
[INFO] Apache HBase ....................................... SUCCESS [  2.079 s]
[INFO] Apache HBase - Checkstyle .......................... SUCCESS [  0.372 s]
[INFO] Apache HBase - Resource Bundle ..................... SUCCESS [  0.116 s]
[INFO] Apache HBase - Annotations ......................... SUCCESS [  0.778 s]
[INFO] Apache HBase - Protocol ............................ SUCCESS [  8.655 s]
[INFO] Apache HBase - Common .............................. SUCCESS [  5.303 s]
[INFO] Apache HBase - Procedure ........................... SUCCESS [  1.025 s]
[INFO] Apache HBase - Client .............................. SUCCESS [  4.763 s]
[INFO] Apache HBase - Hadoop Compatibility ................ SUCCESS [  0.318 s]
[INFO] Apache HBase - Hadoop Two Compatibility ............ SUCCESS [  1.091 s]
[INFO] Apache HBase - Prefix Tree ......................... SUCCESS [  0.896 s]
[INFO] Apache HBase - Server .............................. SUCCESS [03:30 min]
[INFO] Apache HBase - Testing Util ........................ SUCCESS [  1.545 s]
[INFO] Apache HBase - Thrift .............................. SUCCESS [  3.350 s]
[INFO] Apache HBase - Rest ................................ SUCCESS [  1.616 s]
[INFO] Apache HBase - Shell ............................... SUCCESS [  0.658 s]
[INFO] Apache HBase - Integration Tests ................... SUCCESS [  1.173 s]
[INFO] Apache HBase - Examples ............................ SUCCESS [  0.878 s]
[INFO] Apache HBase - External Block Cache ................ SUCCESS [  0.447 s]
[INFO] Apache HBase - Assembly ............................ SUCCESS [  1.208 s]
[INFO] Apache HBase - Shaded .............................. SUCCESS [  0.049 s]
[INFO] Apache HBase - Shaded - Client ..................... SUCCESS [  0.337 s]
[INFO] Apache HBase - Shaded - Server ..................... SUCCESS [  0.466 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 04:08 min
[INFO] Finished at: 2017-07-20T11:33:16-07:00
[INFO] Final Memory: 141M/1571M
[INFO] ------------------------------------------------------------------------
hsun-MBP:hbase hsun$ mvn clean test -Dtest=TestRegionReplicas,TestMultiTableSnapshotInputFormat

{code}

> 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
>          Components: hbck, Operability
>    Affects Versions: 2.0.0-alpha-1
>            Reporter: huaxiang sun
>            Assignee: huaxiang sun
>            Priority: Minor
>             Fix For: 2.0.0-alpha-2
>
>         Attachments: HBASE-18247-branch-1.2-v001.patch
>
>
> 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<HRegionLocation> locations = new ArrayList<>(1);
>      NavigableMap<byte[],NavigableMap<byte[],byte[]>> familyMap = r.getNoVersionMap();
>  
> -    locations.add(getRegionLocation(r, regionInfo, 0));
> +    locations.add(getRegionLocation(r, regionInfo, regionInfo.getReplicaId()));
>  
>      NavigableMap<byte[], byte[]> infoMap = familyMap.get(getCatalogFamily());
>      if (infoMap == null) return new RegionLocations(locations);
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message