[ https://issues.apache.org/jira/browse/HBASE-23376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17000507#comment-17000507 ]
Hudson commented on HBASE-23376: -------------------------------- Results for branch branch-2.2 [build #729 on builds.a.o|https://builds.apache.org/job/HBase%20Nightly/job/branch-2.2/729/]: (x) *{color:red}-1 overall{color}* ---- details (if available): (/) {color:green}+1 general checks{color} -- For more information [see general report|https://builds.apache.org/job/HBase%20Nightly/job/branch-2.2/729//General_Nightly_Build_Report/] (x) {color:red}-1 jdk8 hadoop2 checks{color} -- For more information [see jdk8 (hadoop2) report|https://builds.apache.org/job/HBase%20Nightly/job/branch-2.2/729//JDK8_Nightly_Build_Report_(Hadoop2)/] (/) {color:green}+1 jdk8 hadoop3 checks{color} -- For more information [see jdk8 (hadoop3) report|https://builds.apache.org/job/HBase%20Nightly/job/branch-2.2/729//JDK8_Nightly_Build_Report_(Hadoop3)/] (/) {color:green}+1 source release artifact{color} -- See build output for details. (/) {color:green}+1 client integration test{color} > NPE happens while replica region is moving > ------------------------------------------ > > Key: HBASE-23376 > URL: https://issues.apache.org/jira/browse/HBASE-23376 > Project: HBase > Issue Type: Bug > Components: read replicas > Reporter: Sun Xin > Assignee: Sun Xin > Priority: Minor > Fix For: 3.0.0, 2.3.0, 2.2.3, 2.1.9 > > Attachments: HBASE-23376.branch-2.001.patch, > HBASE-23376.master.v02.dummy.patch, HBASE-23376.master.v02.dummy.patch > > > The following code is from AsyncNonMetaRegionLocator#addToCache > {code:java} > private RegionLocations addToCache(TableCache tableCache, RegionLocations > locs) { > LOG.trace("Try adding {} to cache", locs); > byte[] startKey = locs.getDefaultRegionLocation().getRegion().getStartKey(); > ... > }{code} > we will get a NPE if the locs is without the default region. > > The following code is from > AsyncRegionLocatorHelper#updateCachedLocationOnError > {code:java} > ... > if (cause instanceof RegionMovedException) { > RegionMovedException rme = (RegionMovedException) cause; > HRegionLocation newLoc = > new HRegionLocation(loc.getRegion(), rme.getServerName(), > rme.getLocationSeqNum()); > LOG.debug("Try updating {} with the new location {} constructed by {}", > loc, newLoc, > rme.toString()); > addToCache.accept(newLoc); > ...{code} > If the replica region is moving, we will get a RegionMovedException and add > the HRegionLocation of replica region to cache. And finally NPE happens. > > {code:java} > java.lang.NullPointerExceptionjava.lang.NullPointerException at > org.apache.hadoop.hbase.client.AsyncNonMetaRegionLocator.addToCache(AsyncNonMetaRegionLocator.java:240) > at > org.apache.hadoop.hbase.client.AsyncNonMetaRegionLocator.addLocationToCache(AsyncNonMetaRegionLocator.java:596) > at > org.apache.hadoop.hbase.client.AsyncRegionLocatorHelper.updateCachedLocationOnError(AsyncRegionLocatorHelper.java:80) > at > org.apache.hadoop.hbase.client.AsyncNonMetaRegionLocator.updateCachedLocationOnError(AsyncNonMetaRegionLocator.java:610) > at > org.apache.hadoop.hbase.client.AsyncRegionLocator.updateCachedLocationOnError(AsyncRegionLocator.java:153) > {code} -- This message was sent by Atlassian Jira (v8.3.4#803005)