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 902d4c2 commit 618fc4b
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2170,10 +2170,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 @@ -2208,6 +2213,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 618fc4b

Please sign in to comment.