HBASE-23376 NPE happens while replica region is moving (#906)

Signed-off-by: Duo Zhang <zhangduo@apache.org>
This commit is contained in:
XinSun 2019-12-19 15:11:04 +08:00 committed by Duo Zhang
parent 80ba354e2e
commit 270eb9886e
1 changed files with 1 additions and 1 deletions

View File

@ -237,7 +237,7 @@ class AsyncNonMetaRegionLocator {
// which prevents us being added. The upper layer can use this value to complete pending requests.
private RegionLocations addToCache(TableCache tableCache, RegionLocations locs) {
LOG.trace("Try adding {} to cache", locs);
byte[] startKey = locs.getDefaultRegionLocation().getRegion().getStartKey();
byte[] startKey = locs.getRegionLocation().getRegion().getStartKey();
for (;;) {
RegionLocations oldLocs = tableCache.cache.putIfAbsent(startKey, locs);
if (oldLocs == null) {