Description:
-----------
The Copy/Migration job selection with a Job name was selecting
Jobs that are already migrated. It is leading to a situation where
a new catalog record is created for the new job, but the job is not
used at the end. JobFiles=0 JobBytes=0.
In some conditions, the accurate code selects the incorrect job
record.
In the catalog, both Job records have the same attributes
(same JobTDate, same StartTime). So the selection process
was returning one or the other depending on the weather cast.
We no longer try to copy/migrate a job that is not a valid
Backup job, and we check that the Job status is T.
jcr->get_ActionName(0),
db_strerror(jcr->db));
jcr->setJobStatus(JS_Terminated);
- mac_cleanup(jcr, JS_Terminated, JS_Terminated);
+ mac_cleanup(jcr, JS_Canceled, JS_Canceled);
return true;
}
/* Make sure this job was not already migrated */
jcr->get_ActionName(1),
jcr->get_OperationName());
jcr->setJobStatus(JS_Terminated);
- mac_cleanup(jcr, JS_Terminated, JS_Terminated);
+ mac_cleanup(jcr, JS_Canceled, JS_Canceled);
return true;
}
/* Get JobIds from regex'ed Job names */
static const char *sql_jobids_from_job =
"SELECT DISTINCT Job.JobId,Job.StartTime FROM Job,Pool"
- " WHERE Job.Name='%s' AND Pool.Name='%s' AND Job.PoolId=Pool.PoolId"
+ " WHERE Job.Name='%s' AND Pool.Name='%s' AND Job.Type IN ('B','C') "
+ " AND Job.JobStatus IN ('T','W') AND Job.PoolId=Pool.PoolId "
" ORDER by Job.StartTime";
/* Get Client names in Pool */