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:
chenglei 2021-10-26 14:44:33 +08:00 committed by Duo Zhang
parent 8392dc0ad2
commit 1487d62d21
1 changed files with 5 additions and 1 deletions

View File

@ -3823,7 +3823,8 @@ public class RSRpcServices implements HBaseRPCErrorHandler,
long masterSystemTime = request.hasMasterSystemTime() ? request.getMasterSystemTime() : -1;
for (RegionOpenInfo regionOpenInfo : request.getOpenInfoList()) {
RegionInfo regionInfo = ProtobufUtil.toRegionInfo(regionOpenInfo.getRegion());
TableDescriptor tableDesc = tdCache.get(regionInfo.getTable());
TableName tableName = regionInfo.getTable();
TableDescriptor tableDesc = tdCache.get(tableName);
if (tableDesc == null) {
try {
tableDesc = regionServer.getTableDescriptors().get(regionInfo.getTable());
@ -3835,6 +3836,9 @@ public class RSRpcServices implements HBaseRPCErrorHandler,
LOG.warn("Failed to get TableDescriptor of {}, will try again in the handler",
regionInfo.getTable(), e);
}
if(tableDesc != null) {
tdCache.put(tableName, tableDesc);
}
}
if (regionOpenInfo.getFavoredNodesCount() > 0) {
regionServer.updateRegionFavoredNodesMapping(regionInfo.getEncodedName(),