Skip to content

Commit

Permalink
HBASE-22742 [HBCK2] Add more log for hbck operations at master side
Browse files Browse the repository at this point in the history
Signed-off-by: stack <stack@apache.org>
  • Loading branch information
infraio committed Jul 27, 2019
1 parent 5ab3f76 commit da4d72c
Showing 1 changed file with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2349,11 +2349,12 @@ public GetTableStateResponse setTableStateInMeta(RpcController controller,
SetTableStateInMetaRequest request) throws ServiceException {
TableName tn = ProtobufUtil.toTableName(request.getTableName());
try {
HBaseProtos.TableState prevState =
this.master.getTableStateManager().getTableState(tn).convert();
this.master.getTableStateManager().setTableState(tn,
TableState.convert(tn, request.getTableState()).getState());
return GetTableStateResponse.newBuilder().setTableState(prevState).build();
TableState prevState = this.master.getTableStateManager().getTableState(tn);
TableState newState = TableState.convert(tn, request.getTableState());
LOG.info("{} set table={} state from {} to {}", master.getClientIdAuditPrefix(),
tn, prevState.getState(), newState.getState());
this.master.getTableStateManager().setTableState(tn, newState.getState());
return GetTableStateResponse.newBuilder().setTableState(prevState.convert()).build();
} catch (Exception e) {
throw new ServiceException(e);
}
Expand Down Expand Up @@ -2390,14 +2391,14 @@ private RegionInfo getRegionInfo(HBaseProtos.RegionSpecifier rs) throws UnknownR
public MasterProtos.AssignsResponse assigns(RpcController controller,
MasterProtos.AssignsRequest request)
throws ServiceException {
LOG.info(master.getClientIdAuditPrefix() + " assigns");
if (this.master.getMasterProcedureExecutor() == null) {
throw new ServiceException("Master's ProcedureExecutor not initialized; retry later");
}
MasterProtos.AssignsResponse.Builder responseBuilder =
MasterProtos.AssignsResponse.newBuilder();
try {
boolean override = request.getOverride();
LOG.info("{} assigns, override={}", master.getClientIdAuditPrefix(), override);
for (HBaseProtos.RegionSpecifier rs: request.getRegionList()) {
RegionInfo ri = getRegionInfo(rs);
if (ri == null) {
Expand All @@ -2422,14 +2423,14 @@ public MasterProtos.AssignsResponse assigns(RpcController controller,
public MasterProtos.UnassignsResponse unassigns(RpcController controller,
MasterProtos.UnassignsRequest request)
throws ServiceException {
LOG.info(master.getClientIdAuditPrefix() + " unassigns");
if (this.master.getMasterProcedureExecutor() == null) {
throw new ServiceException("Master's ProcedureExecutor not initialized; retry later");
}
MasterProtos.UnassignsResponse.Builder responseBuilder =
MasterProtos.UnassignsResponse.newBuilder();
try {
boolean override = request.getOverride();
LOG.info("{} unassigns, override={}", master.getClientIdAuditPrefix(), override);
for (HBaseProtos.RegionSpecifier rs: request.getRegionList()) {
RegionInfo ri = getRegionInfo(rs);
if (ri == null) {
Expand Down Expand Up @@ -2461,6 +2462,9 @@ public MasterProtos.UnassignsResponse unassigns(RpcController controller,
public MasterProtos.BypassProcedureResponse bypassProcedure(RpcController controller,
MasterProtos.BypassProcedureRequest request) throws ServiceException {
try {
LOG.info("{} bypass procedures={}, waitTime={}, override={}, recursive={}",
master.getClientIdAuditPrefix(), request.getProcIdList(), request.getWaitTime(),
request.getOverride(), request.getRecursive());
List<Boolean> ret =
master.getMasterProcedureExecutor().bypassProcedure(request.getProcIdList(),
request.getWaitTime(), request.getOverride(), request.getRecursive());
Expand All @@ -2479,6 +2483,8 @@ public MasterProtos.ScheduleServerCrashProcedureResponse scheduleServerCrashProc
try {
for (HBaseProtos.ServerName serverName : serverNames) {
ServerName server = ProtobufUtil.toServerName(serverName);
LOG.info("{} schedule ServerCrashProcedure for {}",
master.getClientIdAuditPrefix(), server);
if (shouldSubmitSCP(server)) {
master.getServerManager().moveFromOnlineToDeadServers(server);
ProcedureExecutor<MasterProcedureEnv> procExec = this.master.getMasterProcedureExecutor();
Expand Down

0 comments on commit da4d72c

Please sign in to comment.