diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java index dde70a8a6a52..e0b80a10e882 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterRpcServices.java @@ -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) { @@ -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) {