On 11/20/24 3:59 PM, Justin Case wrote:
Thanks, however this doesn’t really explain what I was asking for.

Right... I think I realized this might be the case after I sent it. I was trying to reply while working from our booth at the SC24 convention in freezing cold temps, so not thinking clearly. :)


The Copy Job seems to reference to the Backup Job volumes, not to the Copy Job 
volumes, whereas the Copy Control Jo references to the Copy Job volumes.

Only in the joblog table, console messages output, and job log text file... 
(see below)


When the Backup Job gets expired, and the Copy Control Job gets expired this 
merely leaves the Copy Job promted to a Backup Job in the catalog, which, 
however, only seems to reference the original Backup volumes and NOT the Copy 
Job volumes….

How does Bacula still know which Copy volumes belong to the promoted Copy Job?

So basically, Bacula is getting some of this information that is conflicting (and confusing you) from two different places. First, the job log information from the `Log` table (or log file), and where it matters: from the `Jobmedia` table.

Take a look:

Backup Job: 69105
* ll joblog jobid=69105 shows in the Job log summary:
Volume name(s): c0_0016_0083|c0_0016_0084|c0_0016_0080|c0_0016_0077|c0_0016_0086


Copy Control Job: 69125
* ll joblog jobid=69125 shows in the Job log summary:
Volume name(s): syn_vol-3155|syn_vol-3151|syn_vol-3158|syn_vol-3157    <-- 
These are the volumes that the Copy was written to


Copy Job: 69128
* ll joblog jobid=69128 shows (confusingly) in the Job log summary, the volumes 
from the original Backup job:
Volume name(s): c0_0016_0083|c0_0016_0084|c0_0016_0080|c0_0016_0077|c0_0016_0086


However, when we query the for the media used in the Copy (even before purging the original Backup job), we see that the media is correct:

* list media jobid=69128
Jobid 69128 used 4 Volume(s): syn_vol-3155|syn_vol-3151|syn_vol-3158|syn_vol-3157  
              <----------- Correct volumes
+--------+--------+---------------------+------+-------+----------+----------------+-----------+
| jobid  | name   | starttime           | type | level | jobfiles | jobbytes    
   | jobstatus |
+--------+--------+---------------------+------+-------+----------+----------------+-----------+
| 69,128 | Bacula | 2024-11-22 20:16:43 | C    | I     |  106,589 | 
30,021,116,813 | T         |
+--------+--------+---------------------+------+-------+----------+----------------+-----------+


I am assuming that this difference is because during the Copy Control job (jobid 69125), the joblog information from the original backup job (jobid 69105) is copied into the log table for the new Copy job. (Not great, I know...), and you will see the original Backup jobid log entries mixed in with the log lines of the Copy Control job...

But, the actual volumes used to write the Copy Job are properly written into the Jobmedia table so when the Copy gets promoted to a Backup, Bacula knows the correct volumes where its data was written to.

You can prove this using the SQL query mode of bconsole:
----8<----
*sql
Entering SQL query mode.
Terminate each query with a semicolon.
Terminate query mode with a blank line.
Enter SQL query: SELECT DISTINCT mediaid FROM jobmedia WHERE jobid=69128;
+---------+
| mediaid |
+---------+
|   3,151 |
|   3,155 |
|   3,157 |
|   3,158 |
+---------+
----8<----

Then, for each of the mediaIDs listed in this output, you can get their names to see that they match the bconsole `list media jobid=69128` volumes from above:
----8<----
Enter SQL query: SELECT mediaid, volumename FROM media WHERE mediaid IN 
('3155', '3151', '3158', '3157');
+---------+--------------+
| mediaid | volumename   |
+---------+--------------+
|   3,157 | syn_vol-3157 |
|   3,155 | syn_vol-3155 |
|   3,151 | syn_vol-3151 |
|   3,158 | syn_vol-3158 |
+---------+--------------+
----8<----


So, I guess the simple answer you were looking for is: Bacula keeps track of the volumes used for a Copy job in the Jobmedia table, just like it does with Backup jobs. :)



Hope this helps,
Bill

--
Bill Arlofski
w...@protonmail.com

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to