Bug 1971699

Summary: Compatibility issue with bacula + mariadb + mysqldump from community-mysql
Product: [Fedora] Fedora Reporter: Paul Howarth <paul>
Component: baculaAssignee: Simone Caronni <negativo17>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 34CC: andreas, jridky, negativo17, phracek, rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-06-14 17:42:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Paul Howarth 2021-06-14 15:31:30 UTC
Description of problem:
The mysqldump task that runs as part of the catalog backup process does not work properly in Fedora 34 with mariadb-server and mysqldump from community-mysql 8.x:

11-Jun 08:20 tycho-dir JobId 8168: shell command: run BeforeJob "/usr/libexec/bacula/make_catalog_backup.pl MyCatalog"
11-Jun 08:20 tycho-dir JobId 8168: BeforeJob: mysqldump: Couldn't execute 'SELECT COLUMN_NAME,                       JSON_EXTRACT(HISTOGRAM, '$."number-of-buckets-specified"')                FROM information_schema.COLUMN_STATISTICS                WHERE SCHEMA_NAME = 'bacula' AND TABLE_NAME = 'BaseFiles';': Unknown table 'COLUMN_STATISTICS' in information_schema (1109)
(repeated for many tables).
11-Jun 08:22 tycho-dir JobId 8168: Error: Runscript: BeforeJob returned non-zero status=2. ERR=Child exited with code 2
11-Jun 08:22 tycho-dir JobId 8168: Error: Bacula tycho-dir 11.0.3 (21Mar21):

This seems to be because in version 8.0 of community-mysql onwards, the mysqldump command tries to do column statistics by default, which are not supported by mariadb:
https://serverfault.com/questions/912162/mysqldump-throws-unknown-table-column-statistics-in-information-schema-1109

I have been able to work around this issue by creating /etc/my.cnf.d/zz-no-column-statistics.cnf on my database server, with content:

>>>---------
# MySQL 8 turns on column statistics by default, which is not compatible with MariaDB
# https://serverfault.com/questions/912162/mysqldump-throws-unknown-table-column-statistics-in-information-schema-1109

[mysqldump]
column-statistics=0
<<<---------

A better fix might be to patch the /usr/libexec/bacula/make_catalog_backup.pl script to run mysqldump with the "--column-statistics=0" option specified.

Comment 1 Paul Howarth 2021-06-14 17:42:31 UTC
Looks like my install of mariadb-server using ansible pulled in the community-mysql client rather than the mariadb client, which is an option.

After doing "dnf swap community-mysql mariadb" all was well.