fix seekLeaderStore NPE (#366)

This commit is contained in:
iosmanthus 2021-12-09 16:29:16 +08:00 committed by GitHub
parent bb3ace76c1
commit 1dd7cbabe8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 5 deletions

View File

@ -203,11 +203,14 @@ public abstract class AbstractRegionStoreClient
"update leader using switchLeader logic from store[%d] to store[%d]",
region.getLeader().getStoreId(), peer.getStoreId()));
// update region cache
region = regionManager.updateLeader(region, peer.getStoreId());
// switch to leader store
store = currentLeaderStore;
updateClientStub();
return true;
TiRegion result = regionManager.updateLeader(region, peer.getStoreId());
if (result != null) {
region = result;
// switch to leader store
store = currentLeaderStore;
updateClientStub();
}
return false;
}
} else {
// no leader found, some response does not return normally, there may be network partition.