fix key not in region (#104)

Signed-off-by: birdstorm <samuelwyf@hotmail.com>
This commit is contained in:
birdstorm 2020-12-23 11:20:41 +08:00 committed by GitHub
parent 0d15c5269c
commit a0229f56aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -1032,20 +1032,20 @@ public class RegionStoreClient extends AbstractRegionStoreClient {
this);
}
public RegionStoreClient build(TiRegion region, Store store) throws GrpcException {
public synchronized RegionStoreClient build(TiRegion region, Store store) throws GrpcException {
return build(region, store, TiStoreType.TiKV);
}
public RegionStoreClient build(ByteString key) throws GrpcException {
public synchronized RegionStoreClient build(ByteString key) throws GrpcException {
return build(key, TiStoreType.TiKV);
}
public RegionStoreClient build(ByteString key, TiStoreType storeType) throws GrpcException {
public synchronized RegionStoreClient build(ByteString key, TiStoreType storeType) throws GrpcException {
Pair<TiRegion, Store> pair = regionManager.getRegionStorePairByKey(key, storeType);
return build(pair.first, pair.second, storeType);
}
public RegionStoreClient build(TiRegion region) throws GrpcException {
public synchronized RegionStoreClient build(TiRegion region) throws GrpcException {
Store store = regionManager.getStoreById(region.getLeader().getStoreId());
return build(region, store, TiStoreType.TiKV);
}