Eric Bollengier [Wed, 3 Feb 2021 15:37:37 +0000 (16:37 +0100)]
Fix copy/migration job selection
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.
The duplicate plugin command prohibits a proper backend switching
and leads to backup errors. This is a configuration issue and Bacula
plugin API limitation. Now we will detect it and properly handle.
This is a final metaplugin refactoring which allow to move
all metaplugin based plugins (kubernetes, swift and rhv) to use
a common code base removing all unwanted coding and introduce
a static configuration only. Now all you need to define a next
metaplugin is to define a following variables and link metaplugin.lo:
Now metaplugin test backend can support dedicated regression testing
parameters which modify the backend behavior, i.e. you can fail the job
on request or force other errors.
Eric Bollengier [Mon, 1 Feb 2021 10:20:02 +0000 (11:20 +0100)]
Initialize StartTime in db_create_job_record()
We initialize the StarTime DB field earlier in db_create_job_record()
to avoid strange behaviors when the job is canceled before the actual
start of the job.
When the StartTime field is NULL, the "list jobs" is incorrect, the
job output is also incorrect.
Eric Bollengier [Wed, 6 Jan 2021 14:29:40 +0000 (15:29 +0100)]
Fix org#2588 About incorrect Object/ObjectId type in update_postgresql_tables
The Object/ObjectId field has the type serial when the schema is upgraded with
update_postgresql_tables while it has the type bigserial when the DB is created
with make_postgresql_tables.
To fix manually the problem, it is possible to exectute the following SQL command:
Eric Bollengier [Mon, 28 Dec 2020 15:59:56 +0000 (16:59 +0100)]
Fix #7164 About Director reload issue with missing Job's directive
Description:
-----------
When a required directive is removed (like the FileSet directive from the Job resource)
and the reload command is issued, the Director process is doing a M_ERROR_TERM.
10-Dec 14:31 zog8-dir ERROR TERMINATION
"Fileset" directive in Job "BackupClient1" resource is required, but not found.
Workaround:
-----------
Use bacula-dir -t or breload to validate the configuration before the reload.
Alain Spineux [Wed, 23 Dec 2020 15:05:11 +0000 (16:05 +0100)]
regress: copy-job-test add option to force the copy to rehydrate the data
- only available if FORCE_DEDUP = 1
- set XPARAM NEXT_NODEDUP to yes to change the target device of the copy
job to a "File" device and force the copy job to do the rehydration
( just notice that the restore at the end also do the rehydration )
Eric Bollengier [Tue, 15 Dec 2020 12:48:27 +0000 (13:48 +0100)]
Fix MySQL update procedure with incorrect handling of the FileIndex type
Upgrade fails as follows:
This script will update a Bacula MySQL database
from any from version 12-15 or 1014-1021 to version 1022
which is needed to convert from any Bacula Enterprise
version 4.0.x or later to version 12.4.x
or Bacula Community versions 5.0.x, 5.2.x, 7.4.x, 9.x.x to
Community version 11.0
Depending on the current version of your catalog, you may
have to run this script multiple times
ERROR 1264 (22003) at line 24: Out of range value for column 'FileIndex' at row 1
Update of Bacula MySQL tables from 16 to 1017 failed.
This would indicate that the file_temp table is using an unsigned
version of FileIndex however it should be signed, so changing the
schema of that temp table makes it go further,
Michal Rakowski [Thu, 3 Dec 2020 15:52:40 +0000 (16:52 +0100)]
Introduce more filters for 'delete object' command
Now objects can be deleted in groups using 'category', 'type',
'uuid', 'name' and 'source' filters.
Single object could be also specified and all objects related to it will
be deleted as well.