[BugFix: resume suspend longjob when mn left
@@ -525,6 +525,7 @@ public class LongJobManagerImpl extends AbstractService implements LongJobManage
public void nodeLeft(ManagementNodeInventory inv) {
logger.debug(String.format("Management node[uuid:%s] left, node[uuid:%s] starts to take over longjobs", inv.getUuid(), Platform.getManagementServerId()));
takeOverLongJob();
+ resumeLocalSuspendLongJob();
}
@Override
@@ -536,6 +537,18 @@ public class LongJobManagerImpl extends AbstractService implements LongJobManage
public void iJoin(ManagementNodeInventory inv) {
}
+ private void resumeLocalSuspendLongJob() {
+ logger.debug("Starting to resume local suspend long jobs");
+ List<LongJobVO> jobs = Q.New(LongJobVO.class)
+ .eq(LongJobVO_.managementNodeUuid, Platform.getManagementServerId())
+ .eq(LongJobVO_.state, LongJobState.Suspended)
+ .list();
+ for (LongJobVO vo : jobs) {
+ LongJobOperation operation = getLoadOperation(vo);
+ doLoadLongJob(vo, operation);
+ }
+ }
+
private void takeOverLongJob() {
logger.debug("Starting to take over long jobs");
final int group = 1000;
