From da4d72c2d4e02ce446759ac3e9761b95e9e854a7 Mon Sep 17 00:00:00 2001 From: Guanghao Zhang Date: Sat, 27 Jul 2019 12:25:11 +0800 Subject: [PATCH] HBASE-22742 [HBCK2] Add more log for hbck operations at master side Signed-off-by: stack --- .../hbase/master/MasterRpcServices.java | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) 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 8188cf2c119..c2959b690cc 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 @@ -2349,11 +2349,12 @@ public class MasterRpcServices extends RSRpcServices 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); } @@ -2390,7 +2391,6 @@ public class MasterRpcServices extends RSRpcServices 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"); } @@ -2398,6 +2398,7 @@ public class MasterRpcServices extends RSRpcServices 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) { @@ -2422,7 +2423,6 @@ public class MasterRpcServices extends RSRpcServices 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"); } @@ -2430,6 +2430,7 @@ public class MasterRpcServices extends RSRpcServices 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) { @@ -2461,6 +2462,9 @@ public class MasterRpcServices extends RSRpcServices 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 ret = master.getMasterProcedureExecutor().bypassProcedure(request.getProcIdList(), request.getWaitTime(), request.getOverride(), request.getRecursive()); @@ -2479,6 +2483,8 @@ public class MasterRpcServices extends RSRpcServices 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 procExec = this.master.getMasterProcedureExecutor();