Hello Arno,

Thanks for the tests, it's clear that FileIndex can now be negative at
some point, so it's important to specify this attribute correctly.

Note that the modification of the schema table (DDL) cannot be protected
by a transaction with MySQL. So, if a problem appears during the schema
modification, a backup is welcome to start again.

The suggested patch will be applied to the source,

Thanks,

Best Regards,
Eric

On 2020-12-15 13:34, Arno Lehmann wrote:
> Hi all,
> 
> (sent this yesterday to the wrong address... let's retry :-)
> 
> I guess the subject says it all, but here are some details:
> 
> - Bacula version being upgraded is 9.6.6
> The current version of the database:
> +-----------+
> | VersionId |
> +-----------+
> |        16 |
> +-----------+
> 
> - 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,
> 
> 
> - after this fix, it will still show errors:
> 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
> 
> Update of Bacula MySQL tables from 16 to 1017 succeeded.
> ERROR 1050 (42S01) at line 2: Table 'FileMedia' already exists
> Update of Bacula MySQL tables from 1017 to 1018 succeeded.
> ERROR 1264 (22003) at line 2: Out of range value for column 'FileIndex'
> at row 1626663
> Update of Bacula MySQL tables 1018 to 1019 succeeded. (From 16)
> Update of Bacula MySQL tables 1019 to 1020 succeeded.
> Update of Bacula MySQL tables 1020 to 1021 succeeded.
> ERROR 1050 (42S01) at line 3: Table 'TagJob' already exists
> ERROR 1050 (42S01) at line 10: Table 'TagClient' already exists
> ERROR 1050 (42S01) at line 17: Table 'TagMedia' already exists
> ERROR 1050 (42S01) at line 24: Table 'TagObject' already exists
> ERROR 1050 (42S01) at line 31: Table 'Object' already exists
> ERROR 1061 (42000) at line 48: Duplicate key name 'object_jobid_idx'
> ERROR 1061 (42000) at line 49: Duplicate key name 'object_type_idx'
> ERROR 1061 (42000) at line 50: Duplicate key name 'object_name_idx'
> ERROR 1061 (42000) at line 51: Duplicate key name 'object_source_idx'
> ERROR 1050 (42S01) at line 53: Table 'Events' already exists
> ERROR 1061 (42000) at line 66: Duplicate key name 'events_time_idx'
> Update of Bacula MySQL tables 1021 to 1022 succeeded.
> 
> 
> 
> The above may or may not be a real success; this problem was reported to
> me by someone who could not subscribe the the list (which way be another
> issue...)
> 
> 
> In any case, the MySQL upgrade script seems to need some additional
> attention. So, if someone with a MySQL instance available feels inclined
> to have a look, I know of at least one happy user :-)
> 
> 
> 
> By now, i.e. since yesterday, the user noticing this created and patch
> which probably is worth looking at:
> 
> --- update_mysql_tables.orig    Tue Dec 15 10:27:22 2020
> +++ update_mysql_tables Tue Dec 15 10:57:10 2020
> @@ -168,7 +168,7 @@
> 
> 
> 
> CREATE TABLE file_temp (
> 
> 
> FileId BIGINT UNSIGNED NOT NULL,
> -   FileIndex INTEGER UNSIGNED DEFAULT 0,
> +   FileIndex INTEGER DEFAULT 0,
> 
> 
> JobId INTEGER UNSIGNED NOT NULL,
> 
> 
> PathId INTEGER UNSIGNED NOT NULL,
> 
> 
> Filename BLOB NOT NULL,
> @@ -321,9 +321,9 @@
> 
> 
> if [ "$SKIP1018" = 1 -a "$DBVERSION" -eq 1018 ]; then
> 
> 
> if mysql $* -f  <<END-OF-DATA
> 
> 
> USE ${db_name};
> -ALTER TABLE File MODIFY FileIndex INTEGER UNSIGNED DEFAULT 0;
> -ALTER TABLE RestoreObject MODIFY FileIndex INTEGER UNSIGNED DEFAULT 0;
> -ALTER TABLE BaseFiles MODIFY FileIndex INTEGER UNSIGNED DEFAULT 0;
> +ALTER TABLE File MODIFY FileIndex INTEGER DEFAULT 0;
> +ALTER TABLE RestoreObject MODIFY FileIndex INTEGER DEFAULT 0;
> +ALTER TABLE BaseFiles MODIFY FileIndex INTEGER DEFAULT 0;
> 
> 
> UPDATE Version SET VersionId=1019;
> 
> 
> END-OF-DATA
> 
> 
> then
> 
> 
> (patch ends above this line)
> 
> 
> Cheers,
> 
> Arno
> 
> 
> PS:
> I also noted that I can not get a password reset link from
> bugs.bacula.org because I need to know my user name and mail address for
> reseting, or sign up with a different mail addres...
> 
> 
> 
> 
> 



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

Reply via email to