Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Aug 25, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2227,10 +2227,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);
}
pankaj72981 marked this conversation as resolved.
Show resolved Hide resolved
} 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 @@ -2265,6 +2270,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