HBASE-14239 Fix Branch-1.2 AM can get stuck when meta moves

This commit is contained in:
Elliott Clark 2015-08-18 10:52:07 -07:00
parent 303ef340db
commit 585f8fa8a5
3 changed files with 19 additions and 12 deletions

View File

@ -34,8 +34,7 @@ import org.apache.hadoop.hbase.classification.InterfaceStability;
import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Action; import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.Action;
import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MultiRequest; import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MultiRequest;
import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutateRequest; import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutateRequest;
import org.apache.hadoop.hbase.protobuf.generated import org.apache.hadoop.hbase.protobuf.generated.RegionServerStatusProtos;
.RegionServerStatusProtos.ReportRegionStateTransitionRequest;
import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.RegionAction; import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.RegionAction;
import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ScanRequest; import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ScanRequest;
import org.apache.hadoop.hbase.protobuf.generated.RPCProtos.RequestHeader; import org.apache.hadoop.hbase.protobuf.generated.RPCProtos.RequestHeader;
@ -189,7 +188,19 @@ public class RWQueueRpcExecutor extends RpcExecutor {
if (param instanceof MutateRequest) { if (param instanceof MutateRequest) {
return true; return true;
} }
if (param instanceof ReportRegionStateTransitionRequest) { // Below here are methods for master. It's a pretty brittle version of this.
// Not sure that master actually needs a read/write queue since 90% of requests to
// master are writing to status or changing the meta table.
// All other read requests are admin generated and can be processed whenever.
// However changing that would require a pretty drastic change and should be done for
// the next major release and not as a fix for HBASE-14239
if (param instanceof RegionServerStatusProtos.ReportRegionStateTransitionRequest) {
return true;
}
if (param instanceof RegionServerStatusProtos.RegionServerStartupRequest) {
return true;
}
if (param instanceof RegionServerStatusProtos.RegionServerReportRequest) {
return true; return true;
} }
return false; return false;

View File

@ -278,7 +278,7 @@ public class MasterRpcServices extends RSRpcServices
} }
@Override @Override
@QosPriority(priority=HConstants.ADMIN_QOS) @QosPriority(priority = HConstants.ADMIN_QOS)
public GetLastFlushedSequenceIdResponse getLastFlushedSequenceId(RpcController controller, public GetLastFlushedSequenceIdResponse getLastFlushedSequenceId(RpcController controller,
GetLastFlushedSequenceIdRequest request) throws ServiceException { GetLastFlushedSequenceIdRequest request) throws ServiceException {
try { try {
@ -292,7 +292,6 @@ public class MasterRpcServices extends RSRpcServices
} }
@Override @Override
@QosPriority(priority=HConstants.ADMIN_QOS)
public RegionServerReportResponse regionServerReport( public RegionServerReportResponse regionServerReport(
RpcController controller, RegionServerReportRequest request) throws ServiceException { RpcController controller, RegionServerReportRequest request) throws ServiceException {
try { try {
@ -313,7 +312,6 @@ public class MasterRpcServices extends RSRpcServices
} }
@Override @Override
@QosPriority(priority=HConstants.ADMIN_QOS)
public RegionServerStartupResponse regionServerStartup( public RegionServerStartupResponse regionServerStartup(
RpcController controller, RegionServerStartupRequest request) throws ServiceException { RpcController controller, RegionServerStartupRequest request) throws ServiceException {
// Register with server manager // Register with server manager
@ -339,7 +337,6 @@ public class MasterRpcServices extends RSRpcServices
} }
@Override @Override
@QosPriority(priority=HConstants.ADMIN_QOS)
public ReportRSFatalErrorResponse reportRSFatalError( public ReportRSFatalErrorResponse reportRSFatalError(
RpcController controller, ReportRSFatalErrorRequest request) throws ServiceException { RpcController controller, ReportRSFatalErrorRequest request) throws ServiceException {
String errorText = request.getErrorMessage(); String errorText = request.getErrorMessage();
@ -1319,7 +1316,6 @@ public class MasterRpcServices extends RSRpcServices
} }
@Override @Override
@QosPriority(priority=HConstants.ADMIN_QOS)
public ReportRegionStateTransitionResponse reportRegionStateTransition(RpcController c, public ReportRegionStateTransitionResponse reportRegionStateTransition(RpcController c,
ReportRegionStateTransitionRequest req) throws ServiceException { ReportRegionStateTransitionRequest req) throws ServiceException {
try { try {

View File

@ -45,12 +45,12 @@ public class TestMasterPriorityRpc {
private PriorityFunction priority = null; private PriorityFunction priority = null;
private User user = null; private User user = null;
private final Set<String> ADMIN_METHODS = Sets.newHashSet("GetLastFlushedSequenceId", private final Set<String> ADMIN_METHODS = Sets.newHashSet("GetLastFlushedSequenceId");
"RegionServerReport", "RegionServerStartup", "ReportRSFatalError",
"ReportRegionStateTransition");
private final Set<String> NORMAL_METHODS = Sets.newHashSet("CreateTable", "DeleteTable", private final Set<String> NORMAL_METHODS = Sets.newHashSet("CreateTable", "DeleteTable",
"ModifyColumn", "OfflineRegion", "Shutdown"); "ModifyColumn", "OfflineRegion", "Shutdown",
"RegionServerReport", "RegionServerStartup", "ReportRSFatalError",
"ReportRegionStateTransition");
@Before @Before
public void setup() { public void setup() {