Apache9 commented on code in PR #5502:
URL: https://github.com/apache/hbase/pull/5502#discussion_r1568321401
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/DeleteTableProcedure.java:
##########
@@ -133,12 +139,25 @@ protected Flow executeFromState(final MasterProcedureEnv
env, DeleteTableState s
if (isRollbackSupported(state)) {
setFailure("master-delete-table", e);
} else {
- LOG.warn("Retriable error trying to delete table=" + getTableName() +
" state=" + state, e);
+ if (retryCounter == null) {
+ retryCounter =
ProcedureUtil.createRetryCounter(env.getMasterConfiguration());
+ }
+ long backoff = retryCounter.getBackoffTimeAndIncrementAttempts();
+ LOG.warn("Retriable error trying to delete table={},state={},suspend
{}secs.",
+ getTableName(), state, backoff / 1000, e);
+ throw suspend(Math.toIntExact(backoff), true);
}
}
return Flow.HAS_MORE_STATE;
Review Comment:
Ditto.
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/CreateTableProcedure.java:
##########
@@ -137,12 +143,25 @@ protected Flow executeFromState(final MasterProcedureEnv
env, final CreateTableS
if (isRollbackSupported(state)) {
setFailure("master-create-table", e);
} else {
- LOG.warn("Retriable error trying to create table=" + getTableName() +
" state=" + state, e);
+ if (retryCounter == null) {
+ retryCounter =
ProcedureUtil.createRetryCounter(env.getMasterConfiguration());
+ }
+ long backoff = retryCounter.getBackoffTimeAndIncrementAttempts();
+ LOG.warn("Retriable error trying to create table={},state={},suspend
{}secs.",
+ getTableName(), state, backoff / 1000, e);
+ throw suspend(Math.toIntExact(backoff), true);
}
}
return Flow.HAS_MORE_STATE;
Review Comment:
You need to reset the retryCounter to null here. The reason for resetting is
that, if we have successfully finished one step, we should reset the
retryCounter.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]