HBASE-26394 Cache in RSRpcServices.executeProcedures does not take effect (#3794)
Signed-off-by: Xiaolin Ha <haxiaolin@apache.org> Signed-off-by: Duo Zhang <zhangduo@apache.org>
This commit is contained in:
parent
7af5277859
commit
773ff28967
|
@ -3759,7 +3759,8 @@ public class RSRpcServices extends HBaseRpcServicesBase<HRegionServer>
|
||||||
long masterSystemTime = request.hasMasterSystemTime() ? request.getMasterSystemTime() : -1;
|
long masterSystemTime = request.hasMasterSystemTime() ? request.getMasterSystemTime() : -1;
|
||||||
for (RegionOpenInfo regionOpenInfo : request.getOpenInfoList()) {
|
for (RegionOpenInfo regionOpenInfo : request.getOpenInfoList()) {
|
||||||
RegionInfo regionInfo = ProtobufUtil.toRegionInfo(regionOpenInfo.getRegion());
|
RegionInfo regionInfo = ProtobufUtil.toRegionInfo(regionOpenInfo.getRegion());
|
||||||
TableDescriptor tableDesc = tdCache.get(regionInfo.getTable());
|
TableName tableName = regionInfo.getTable();
|
||||||
|
TableDescriptor tableDesc = tdCache.get(tableName);
|
||||||
if (tableDesc == null) {
|
if (tableDesc == null) {
|
||||||
try {
|
try {
|
||||||
tableDesc = server.getTableDescriptors().get(regionInfo.getTable());
|
tableDesc = server.getTableDescriptors().get(regionInfo.getTable());
|
||||||
|
@ -3771,6 +3772,9 @@ public class RSRpcServices extends HBaseRpcServicesBase<HRegionServer>
|
||||||
LOG.warn("Failed to get TableDescriptor of {}, will try again in the handler",
|
LOG.warn("Failed to get TableDescriptor of {}, will try again in the handler",
|
||||||
regionInfo.getTable(), e);
|
regionInfo.getTable(), e);
|
||||||
}
|
}
|
||||||
|
if(tableDesc != null) {
|
||||||
|
tdCache.put(tableName, tableDesc);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (regionOpenInfo.getFavoredNodesCount() > 0) {
|
if (regionOpenInfo.getFavoredNodesCount() > 0) {
|
||||||
server.updateRegionFavoredNodesMapping(regionInfo.getEncodedName(),
|
server.updateRegionFavoredNodesMapping(regionInfo.getEncodedName(),
|
||||||
|
|
Loading…
Reference in New Issue