Skip to content

Commit

Permalink
HBASE-22904 NPE occurs when RS send space quota usage report during H…
Browse files Browse the repository at this point in the history
…Master 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>
  • Loading branch information
Pankaj authored and saintstack committed Aug 25, 2019
1 parent 40d30fc commit 481b2e3
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2193,10 +2193,15 @@ public RegionSpaceUseReportResponse reportRegionSpaceUse(RpcController controlle
return RegionSpaceUseReportResponse.newBuilder().build();
}
MasterQuotaManager quotaManager = this.master.getMasterQuotaManager();
final long now = EnvironmentEdgeManager.currentTime();
for (RegionSpaceUse report : request.getSpaceUseList()) {
quotaManager.addRegionSize(ProtobufUtil.toRegionInfo(
report.getRegionInfo()), report.getRegionSize(), now);
if (quotaManager != null) {
final long now = EnvironmentEdgeManager.currentTime();
for (RegionSpaceUse report : request.getSpaceUseList()) {
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) {
Expand Down Expand Up @@ -2231,6 +2236,9 @@ public GetSpaceQuotaRegionSizesResponse getSpaceQuotaRegionSizes(
.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) {
Expand Down

0 comments on commit 481b2e3

Please sign in to comment.