HBASE-20989 Minor, miscellaneous logging fixes

Signed-off-by: Zach York <zyork@amazon.com>
Signed-off-by: Mingliang Liu <liuml07@apache.org>
This commit is contained in:
Michael Stack 2018-07-31 13:03:13 -07:00
parent 9338eaee65
commit 88f3148810
6 changed files with 22 additions and 21 deletions

View File

@ -952,13 +952,13 @@ class AsyncRequestFutureImpl<CResult> implements AsyncRequestFuture {
Throwable error, long backOffTime, boolean willRetry, String startTime, Throwable error, long backOffTime, boolean willRetry, String startTime,
int failed, int stopped) { int failed, int stopped) {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append("id=").append(asyncProcess.id).append(", table=").append(tableName).append(", ") sb.append("id=").append(asyncProcess.id).append(", table=").append(tableName).
.append("attempt=").append(numAttempt) append(", attempt=").append(numAttempt).append("/").append(asyncProcess.numTries).
.append("/").append(asyncProcess.numTries).append(", "); append(", ");
if (failureCount > 0 || error != null){ if (failureCount > 0 || error != null){
sb.append("failed=").append(failureCount).append("ops").append(", last exception="). sb.append("failureCount=").append(failureCount).append("ops").append(", last exception=").
append(error == null ? "null" : error); append(error);
} else { } else {
sb.append("succeeded"); sb.append("succeeded");
} }
@ -967,15 +967,15 @@ class AsyncRequestFutureImpl<CResult> implements AsyncRequestFuture {
if (willRetry) { if (willRetry) {
sb.append(", retrying after=").append(backOffTime).append("ms"). sb.append(", retrying after=").append(backOffTime).append("ms").
append(", replay=").append(replaySize).append("ops"); append(", operationsToReplay=").append(replaySize);
} else if (failureCount > 0) { } else if (failureCount > 0) {
if (stopped > 0) { if (stopped > 0) {
sb.append("; not retrying ").append(stopped).append(" due to success from other replica"); sb.append("; NOT retrying, stopped=").append(stopped).
append(" because successful operation on other replica");
} }
if (failed > 0) { if (failed > 0) {
sb.append("; not retrying ").append(failed).append(" - final failure"); sb.append("; NOT retrying, failed=").append(failed).append(" -- final attempt!");
} }
} }
return sb.toString(); return sb.toString();

View File

@ -1500,7 +1500,7 @@ public class ProcedureExecutor<TEnvironment> {
private void execProcedure(RootProcedureState<TEnvironment> procStack, private void execProcedure(RootProcedureState<TEnvironment> procStack,
Procedure<TEnvironment> procedure) { Procedure<TEnvironment> procedure) {
Preconditions.checkArgument(procedure.getState() == ProcedureState.RUNNABLE, Preconditions.checkArgument(procedure.getState() == ProcedureState.RUNNABLE,
procedure.toString()); "NOT RUNNABLE! " + procedure.toString());
// Procedures can suspend themselves. They skip out by throwing a ProcedureSuspendedException. // Procedures can suspend themselves. They skip out by throwing a ProcedureSuspendedException.
// The exception is caught below and then we hurry to the exit without disturbing state. The // The exception is caught below and then we hurry to the exit without disturbing state. The

View File

@ -188,7 +188,7 @@ public abstract class AbstractStateMachineTableProcedure<TState>
throw new UnknownRegionException("No RegionState found for " + ri.getEncodedName()); throw new UnknownRegionException("No RegionState found for " + ri.getEncodedName());
} }
if (!rs.isOpened()) { if (!rs.isOpened()) {
throw new DoNotRetryRegionException(ri.getEncodedName() + " is not OPEN"); throw new DoNotRetryRegionException(ri.getEncodedName() + " is not OPEN; regionState=" + rs);
} }
if (ri.isSplitParent()) { if (ri.isSplitParent()) {
throw new DoNotRetryRegionException(ri.getEncodedName() + throw new DoNotRetryRegionException(ri.getEncodedName() +

View File

@ -94,7 +94,7 @@ public class DeleteTableProcedure
} }
// TODO: Move out... in the acquireLock() // TODO: Move out... in the acquireLock()
LOG.debug("Waiting for '" + getTableName() + "' regions in transition"); LOG.debug("Waiting for RIT for {}", this);
regions = env.getAssignmentManager().getRegionStates().getRegionsOfTable(getTableName()); regions = env.getAssignmentManager().getRegionStates().getRegionsOfTable(getTableName());
assert regions != null && !regions.isEmpty() : "unexpected 0 regions"; assert regions != null && !regions.isEmpty() : "unexpected 0 regions";
ProcedureSyncWait.waitRegionInTransition(env, regions); ProcedureSyncWait.waitRegionInTransition(env, regions);
@ -105,29 +105,29 @@ public class DeleteTableProcedure
setNextState(DeleteTableState.DELETE_TABLE_REMOVE_FROM_META); setNextState(DeleteTableState.DELETE_TABLE_REMOVE_FROM_META);
break; break;
case DELETE_TABLE_REMOVE_FROM_META: case DELETE_TABLE_REMOVE_FROM_META:
LOG.debug("delete '" + getTableName() + "' regions from META"); LOG.debug("Deleting regions from META for {}", this);
DeleteTableProcedure.deleteFromMeta(env, getTableName(), regions); DeleteTableProcedure.deleteFromMeta(env, getTableName(), regions);
setNextState(DeleteTableState.DELETE_TABLE_CLEAR_FS_LAYOUT); setNextState(DeleteTableState.DELETE_TABLE_CLEAR_FS_LAYOUT);
break; break;
case DELETE_TABLE_CLEAR_FS_LAYOUT: case DELETE_TABLE_CLEAR_FS_LAYOUT:
LOG.debug("delete '" + getTableName() + "' from filesystem"); LOG.debug("Deleting regions from filesystem for {}", this);
DeleteTableProcedure.deleteFromFs(env, getTableName(), regions, true); DeleteTableProcedure.deleteFromFs(env, getTableName(), regions, true);
setNextState(DeleteTableState.DELETE_TABLE_UPDATE_DESC_CACHE); setNextState(DeleteTableState.DELETE_TABLE_UPDATE_DESC_CACHE);
regions = null; regions = null;
break; break;
case DELETE_TABLE_UPDATE_DESC_CACHE: case DELETE_TABLE_UPDATE_DESC_CACHE:
LOG.debug("delete '" + getTableName() + "' descriptor"); LOG.debug("Deleting descriptor for {}", this);
DeleteTableProcedure.deleteTableDescriptorCache(env, getTableName()); DeleteTableProcedure.deleteTableDescriptorCache(env, getTableName());
setNextState(DeleteTableState.DELETE_TABLE_UNASSIGN_REGIONS); setNextState(DeleteTableState.DELETE_TABLE_UNASSIGN_REGIONS);
break; break;
case DELETE_TABLE_UNASSIGN_REGIONS: case DELETE_TABLE_UNASSIGN_REGIONS:
LOG.debug("delete '" + getTableName() + "' assignment state"); LOG.debug("Deleting assignment state for {}", this);
DeleteTableProcedure.deleteAssignmentState(env, getTableName()); DeleteTableProcedure.deleteAssignmentState(env, getTableName());
setNextState(DeleteTableState.DELETE_TABLE_POST_OPERATION); setNextState(DeleteTableState.DELETE_TABLE_POST_OPERATION);
break; break;
case DELETE_TABLE_POST_OPERATION: case DELETE_TABLE_POST_OPERATION:
postDelete(env); postDelete(env);
LOG.debug("delete '" + getTableName() + "' completed"); LOG.debug("Finished {}", this);
return Flow.NO_MORE_STATE; return Flow.NO_MORE_STATE;
default: default:
throw new UnsupportedOperationException("unhandled state=" + state); throw new UnsupportedOperationException("unhandled state=" + state);

View File

@ -142,7 +142,7 @@ public class DisableTableProcedure
if (isRollbackSupported(state)) { if (isRollbackSupported(state)) {
setFailure("master-disable-table", e); setFailure("master-disable-table", e);
} else { } else {
LOG.warn("Retriable error trying to disable table={} (in state={})", tableName, state, e); LOG.warn("Retryable error in {}", this, e);
} }
} }
return Flow.HAS_MORE_STATE; return Flow.HAS_MORE_STATE;
@ -256,7 +256,7 @@ public class DisableTableProcedure
TableStateManager tsm = env.getMasterServices().getTableStateManager(); TableStateManager tsm = env.getMasterServices().getTableStateManager();
TableState ts = tsm.getTableState(tableName); TableState ts = tsm.getTableState(tableName);
if (!ts.isEnabled()) { if (!ts.isEnabled()) {
LOG.info("Not ENABLED tableState=" + ts + "; skipping disable"); LOG.info("Not ENABLED skipping {}", this);
setFailure("master-disable-table", new TableNotEnabledException(ts.toString())); setFailure("master-disable-table", new TableNotEnabledException(ts.toString()));
canTableBeDisabled = false; canTableBeDisabled = false;
} }
@ -292,6 +292,7 @@ public class DisableTableProcedure
env.getMasterServices().getTableStateManager().setTableState( env.getMasterServices().getTableStateManager().setTableState(
tableName, tableName,
TableState.State.DISABLING); TableState.State.DISABLING);
LOG.info("Set {} to state={}", tableName, TableState.State.DISABLING);
} }
/** /**
@ -306,7 +307,7 @@ public class DisableTableProcedure
env.getMasterServices().getTableStateManager().setTableState( env.getMasterServices().getTableStateManager().setTableState(
tableName, tableName,
TableState.State.DISABLED); TableState.State.DISABLED);
LOG.info("Disabled table, " + tableName + ", is completed."); LOG.info("Set {} to state={}", tableName, TableState.State.DISABLED);
} }
/** /**

View File

@ -1523,7 +1523,7 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
// the close flag? // the close flag?
if (!abort && worthPreFlushing() && canFlush) { if (!abort && worthPreFlushing() && canFlush) {
status.setStatus("Pre-flushing region before close"); status.setStatus("Pre-flushing region before close");
LOG.info("Running close preflush of {}" + this.getRegionInfo().getEncodedName()); LOG.info("Running close preflush of {}", this.getRegionInfo().getEncodedName());
try { try {
internalFlushcache(status); internalFlushcache(status);
} catch (IOException ioe) { } catch (IOException ioe) {