|
@@ -269,10 +269,14 @@ public class Mover {
|
|
// wait for pending move to finish and retry the failed migration
|
|
// wait for pending move to finish and retry the failed migration
|
|
boolean hasFailed = Dispatcher.waitForMoveCompletion(storages.targets
|
|
boolean hasFailed = Dispatcher.waitForMoveCompletion(storages.targets
|
|
.values());
|
|
.values());
|
|
- if (hasFailed) {
|
|
|
|
|
|
+ boolean hasSuccess = Dispatcher.checkForSuccess(storages.targets
|
|
|
|
+ .values());
|
|
|
|
+ if (hasFailed && !hasSuccess) {
|
|
if (retryCount.get() == retryMaxAttempts) {
|
|
if (retryCount.get() == retryMaxAttempts) {
|
|
- throw new IOException("Failed to move some block's after "
|
|
|
|
|
|
+ result.setRetryFailed();
|
|
|
|
+ LOG.error("Failed to move some block's after "
|
|
+ retryMaxAttempts + " retries.");
|
|
+ retryMaxAttempts + " retries.");
|
|
|
|
+ return result;
|
|
} else {
|
|
} else {
|
|
retryCount.incrementAndGet();
|
|
retryCount.incrementAndGet();
|
|
}
|
|
}
|
|
@@ -713,10 +717,12 @@ public class Mover {
|
|
|
|
|
|
private boolean hasRemaining;
|
|
private boolean hasRemaining;
|
|
private boolean noBlockMoved;
|
|
private boolean noBlockMoved;
|
|
|
|
+ private boolean retryFailed;
|
|
|
|
|
|
Result() {
|
|
Result() {
|
|
hasRemaining = false;
|
|
hasRemaining = false;
|
|
noBlockMoved = true;
|
|
noBlockMoved = true;
|
|
|
|
+ retryFailed = false;
|
|
}
|
|
}
|
|
|
|
|
|
boolean isHasRemaining() {
|
|
boolean isHasRemaining() {
|
|
@@ -735,16 +741,25 @@ public class Mover {
|
|
this.noBlockMoved = noBlockMoved;
|
|
this.noBlockMoved = noBlockMoved;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ void setRetryFailed() {
|
|
|
|
+ this.retryFailed = true;
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
- * @return SUCCESS if all moves are success and there is no remaining move.
|
|
|
|
|
|
+ * @return NO_MOVE_PROGRESS if no progress in move after some retry. Return
|
|
|
|
+ * SUCCESS if all moves are success and there is no remaining move.
|
|
* Return NO_MOVE_BLOCK if there moves available but all the moves
|
|
* Return NO_MOVE_BLOCK if there moves available but all the moves
|
|
* cannot be scheduled. Otherwise, return IN_PROGRESS since there
|
|
* cannot be scheduled. Otherwise, return IN_PROGRESS since there
|
|
* must be some remaining moves.
|
|
* must be some remaining moves.
|
|
*/
|
|
*/
|
|
ExitStatus getExitStatus() {
|
|
ExitStatus getExitStatus() {
|
|
- return !isHasRemaining() ? ExitStatus.SUCCESS
|
|
|
|
- : isNoBlockMoved() ? ExitStatus.NO_MOVE_BLOCK
|
|
|
|
- : ExitStatus.IN_PROGRESS;
|
|
|
|
|
|
+ if (retryFailed) {
|
|
|
|
+ return ExitStatus.NO_MOVE_PROGRESS;
|
|
|
|
+ } else {
|
|
|
|
+ return !isHasRemaining() ? ExitStatus.SUCCESS
|
|
|
|
+ : isNoBlockMoved() ? ExitStatus.NO_MOVE_BLOCK
|
|
|
|
+ : ExitStatus.IN_PROGRESS;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|