public MigratorStatus resubmitWorkflowTasks ( String placement ) { MigratorStatus status = _statusDAO . getMigratorStatus ( placement ) ; if ( status == null ) { return null ; } if ( status . getCompleteTime ( ) == null ) { // Resubmit any active tasks for ( ScanRangeStatus active : status . getActiveScanRanges ( ) ) { _workflow . addScanRangeTask ( placement , active . getTaskId ( ) , active . getPlacement ( ) , active . getScanRange ( ) ) ; } // Send notification to evaluate whether any new range tasks can be started _workflow . scanStatusUpdated ( placement ) ; } return status ; }
Sometimes due to unexpected errors while submitting migrator ranges to the underlying queues a migration can get stuck . This method takes all available tasks for a migration and resubmits them . This method is safe because the underlying system is resilient to task resubmissions and concurrent work on the same task .