HBASE-23376 NPE happens while replica region is moving (#906)
Signed-off-by: Duo Zhang <zhangduo@apache.org>
This commit is contained in:
parent
80ba354e2e
commit
270eb9886e
|
@ -237,7 +237,7 @@ class AsyncNonMetaRegionLocator {
|
||||||
// which prevents us being added. The upper layer can use this value to complete pending requests.
|
// which prevents us being added. The upper layer can use this value to complete pending requests.
|
||||||
private RegionLocations addToCache(TableCache tableCache, RegionLocations locs) {
|
private RegionLocations addToCache(TableCache tableCache, RegionLocations locs) {
|
||||||
LOG.trace("Try adding {} to cache", locs);
|
LOG.trace("Try adding {} to cache", locs);
|
||||||
byte[] startKey = locs.getDefaultRegionLocation().getRegion().getStartKey();
|
byte[] startKey = locs.getRegionLocation().getRegion().getStartKey();
|
||||||
for (;;) {
|
for (;;) {
|
||||||
RegionLocations oldLocs = tableCache.cache.putIfAbsent(startKey, locs);
|
RegionLocations oldLocs = tableCache.cache.putIfAbsent(startKey, locs);
|
||||||
if (oldLocs == null) {
|
if (oldLocs == null) {
|
||||||
|
|
Loading…
Reference in New Issue