Apache9 commented on code in PR #5502:
URL: https://github.com/apache/hbase/pull/5502#discussion_r1382350515
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/master/procedure/DeleteTableProcedure.java:
##########
@@ -133,7 +137,13 @@ 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 sleepTime = retryCounter.getBackoffTimeAndIncrementAttempts();
+ LOG.warn("Retriable error trying to delete table=" + getTableName() +
" state=" + state
+ + ", Will sleep " + sleepTime / 1000 + " secs and try again later",
e);
+ Threads.sleep(sleepTime);
Review Comment:
Better not sleep directly here as it will block e PEWorker. You can call
suspend method from the parent Procedure class to suspend the procedure for a
while.
And we also need to reset the retryCounter if there is no problem after
retrying.
--
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]