Skip to content

Commit

Permalink
migration: Only update Job type on success.
Browse files Browse the repository at this point in the history
The attempt to migrate a job whose job resource is not defined in the
current director configuration (because the resource has been removed)
fails with an error like

	Fatal error: Previous Job resource not found for "rur_system_job"

However, in this case the "Type" field of the previous job is still
updated from "B" (backup) to "M" (Migration). This is wrong because
nothing was actually migrated.

This simple patch changes migration_cleanup() to mark the previous
job as migrated only if the migration job terminated successfully.

Signed-off-by: Andre Noll <maan@tuebingen.mpg.de>
  • Loading branch information
Andre Noll authored and Marco van Wieringen committed Nov 26, 2015
1 parent 9f159cc commit 403124b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/dird/migrate.c
Expand Up @@ -1687,7 +1687,9 @@ void migration_cleanup(JCR *jcr, int TermCode)
break;
}
} else {
if (jcr->is_JobType(JT_MIGRATE) && jcr->previous_jr.JobId != 0) {
if (jcr->is_JobType(JT_MIGRATE) &&
jcr->previous_jr.JobId != 0 &&
jcr->is_terminated_ok()) {
/*
* Mark previous job as migrated
*/
Expand Down

0 comments on commit 403124b

Please sign in to comment.