Skip to content
Merged
Show file tree
Hide file tree
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 @@ -92,8 +92,8 @@ public int getPriority(RPCProtos.RequestHeader header, Message param, User user)
}
return HConstants.HIGH_QOS;
}
// also use HIGH_QOS for region server report
if (param instanceof RegionServerStatusProtos.RegionServerReportRequest) {
// also use HIGH_QOS for all rest methods in RegionServerStatusProtos
if (RegionServerStatusProtos.class.equals(param.getClass().getEnclosingClass())) {
return HConstants.HIGH_QOS;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,8 @@ protected List<BlockingServiceAndInterface> getServices() {
}

@Override
@QosPriority(priority = HConstants.ADMIN_QOS)
// priority for all RegionServerStatusProtos rpc's are set HIGH_QOS in
// MasterAnnotationReadingPriorityFunction itself
public GetLastFlushedSequenceIdResponse getLastFlushedSequenceId(RpcController controller,
GetLastFlushedSequenceIdRequest request) throws ServiceException {
try {
Expand All @@ -553,7 +554,6 @@ public GetLastFlushedSequenceIdResponse getLastFlushedSequenceId(RpcController c
}

@Override
@QosPriority(priority = HConstants.ADMIN_QOS)
public RegionServerReportResponse regionServerReport(RpcController controller,
RegionServerReportRequest request) throws ServiceException {
try {
Expand Down Expand Up @@ -585,7 +585,6 @@ public RegionServerReportResponse regionServerReport(RpcController controller,
}

@Override
@QosPriority(priority = HConstants.ADMIN_QOS)
public RegionServerStartupResponse regionServerStartup(RpcController controller,
RegionServerStartupRequest request) throws ServiceException {
// Register with server manager
Expand Down Expand Up @@ -617,7 +616,6 @@ public RegionServerStartupResponse regionServerStartup(RpcController controller,
}

@Override
@QosPriority(priority = HConstants.ADMIN_QOS)
public ReportRSFatalErrorResponse reportRSFatalError(RpcController controller,
ReportRSFatalErrorRequest request) throws ServiceException {
String errorText = request.getErrorMessage();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.apache.hadoop.hbase.QosTestHelper;
import org.apache.hadoop.hbase.ServerName;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.client.RegionInfoBuilder;
import org.apache.hadoop.hbase.regionserver.AnnotationReadingPriorityFunction;
import org.apache.hadoop.hbase.regionserver.RSRpcServices;
import org.apache.hadoop.hbase.testclassification.MasterTests;
Expand All @@ -39,6 +40,8 @@
import org.junit.experimental.categories.Category;
import org.mockito.Mockito;

import org.apache.hbase.thirdparty.com.google.protobuf.ByteString;

import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil;
import org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos;
import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos;
Expand Down Expand Up @@ -97,9 +100,35 @@ public void testRegionInTransition() throws IOException {

@Test
public void testAnnotations() {
checkMethod(conf, "GetLastFlushedSequenceId", HConstants.ADMIN_QOS, qosFunction);
checkMethod(conf, "CompactRegion", HConstants.ADMIN_QOS, qosFunction);
checkMethod(conf, "GetLastFlushedSequenceId", HConstants.ADMIN_QOS, qosFunction);
checkMethod(conf, "GetRegionInfo", HConstants.ADMIN_QOS, qosFunction);
}

@Test
public void testRegionServerStatusProtos() {
RegionServerStatusProtos.RemoteProcedureResult splitWalProcedureResult =
RegionServerStatusProtos.RemoteProcedureResult.newBuilder()
.setStatus(RegionServerStatusProtos.RemoteProcedureResult.Status.SUCCESS).setProcId(100)
.build();

RegionServerStatusProtos.ReportProcedureDoneRequest splitWalProcedureDoneReport =
RegionServerStatusProtos.ReportProcedureDoneRequest.newBuilder()
.addResult(splitWalProcedureResult).build();

RegionServerStatusProtos.GetLastFlushedSequenceIdRequest lastFlushedSequenceIdRequest =
RegionServerStatusProtos.GetLastFlushedSequenceIdRequest.newBuilder()
.setRegionName(ByteString.copyFrom(RegionInfoBuilder.FIRST_META_REGIONINFO.getRegionName()))
.build();

RegionServerStatusProtos.RegionServerReportRequest regionServerReportRequest =
RegionServerStatusProtos.RegionServerReportRequest.newBuilder()
.setServer(ProtobufUtil.toServerName(ServerName.valueOf("locahost:60020", 100))).build();

checkMethod(conf, "ReportProcedureDone", HConstants.HIGH_QOS, qosFunction,
splitWalProcedureDoneReport);
checkMethod(conf, "GetLastFlushedSequenceId", HConstants.HIGH_QOS, qosFunction,
lastFlushedSequenceIdRequest);
checkMethod(conf, "RegionServerReport", HConstants.HIGH_QOS, qosFunction,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also add corresponding test for checkMethod(conf, "CompactRegion", HConstants.ADMIN_QOS, qosFunction);?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

won't it make difference in branch-3 and branch-2 ?
While writing I didn't find a good way to add Test for all so just added for some important one.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the point is previous line 101 has checkMethod(conf, "CompactRegion", HConstants.ADMIN_QOS, qosFunction); and that check would still be valid in branch-2, so you don't need to remove that line here.

Ultimately, I'm not sure how important it is, though, since the method is removed in master branch as part of #3612 (d26bcaa and https://issues.apache.org/jira/browse/HBASE-25288)... and it's probably unnecessarily ADMIN_QOS here in branch-2.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added this as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why you didn't just leave it inside the testAnnotations method :)

regionServerReportRequest);
checkMethod(conf, "CompactRegion", HConstants.ADMIN_QOS, qosFunction);
}
}