HBASE-22904 NPE occurs when RS send space quota usage report during HMaster init (#529)

* NPE occurs when RS send space quota usage report during HMaster init

* Added the debug log

 Signed-off-by: Sakthi <sakthi@apache.org>
 Signed-off-by: stack <stack@apache.org>
This commit is contained in:
Pankaj 2019-08-25 09:26:20 +05:30 committed by stack
parent 7300108dfb
commit 5a1603f2ba
1 changed files with 12 additions and 4 deletions

View File

@ -2209,10 +2209,15 @@ public class MasterRpcServices extends RSRpcServices
return RegionSpaceUseReportResponse.newBuilder().build();
}
MasterQuotaManager quotaManager = this.master.getMasterQuotaManager();
if (quotaManager != null) {
final long now = EnvironmentEdgeManager.currentTime();
for (RegionSpaceUse report : request.getSpaceUseList()) {
quotaManager.addRegionSize(ProtobufUtil.toRegionInfo(
report.getRegionInfo()), report.getRegionSize(), now);
quotaManager.addRegionSize(ProtobufUtil.toRegionInfo(report.getRegionInfo()),
report.getRegionSize(), now);
}
} else {
LOG.debug(
"Received region space usage report but HMaster is not ready to process it, skipping");
}
return RegionSpaceUseReportResponse.newBuilder().build();
} catch (Exception e) {
@ -2247,6 +2252,9 @@ public class MasterRpcServices extends RSRpcServices
.setSize(tableSize.getValue()).build());
}
return builder.build();
} else {
LOG.debug(
"Received space quota region size report but HMaster is not ready to process it, skipping");
}
return builder.build();
} catch (Exception e) {