-
Notifications
You must be signed in to change notification settings - Fork 176
MySQL 5.7 (MariaDB 10.2)
This doc serves as collection of changes done when updating MySQL version from 5.6 to 5.7 (which is ~equivalent to upgrade MariaDB from 10.1 or 10.1 to 10.2, 10.3 or 10.4)
NB: for MariaDB compatibity wrt to MySQL please refer to https://mariadb.com/kb/en/mariadb-vs-mysql-compatibility/#drop-in-compatibility-of-specific-mariadb-versions
from https://github.com/DIRACGrid/DIRAC/pull/4503 (v6r22)
USE TransformationDB;
ALTER TABLE Transformations MODIFY TransformationGroup VARCHAR(255) NOT NULL default 'General';
https://github.com/DIRACGrid/DIRAC/pull/3933)
USE AccountingDB
ALTER TABLE `ac_in_LHCb-Production_Job` MODIFY FinalMinorStatus VARCHAR(256) NOT NULL;
ALTER TABLE `ac_key_LHCb-Production_Job_ FinalMinorStatus` MODIFY value VARCHAR(256) NOT NULL;
https://github.com/DIRACGrid/DIRAC/pull/4290 (v7r0) Extend User and Site from 32 to 64 characters in AccountingDB.
USE AccountingDB;
ALTER TABLE ac_in_GridPP_DataOperation MODIFY User VARCHAR(64) NOT NULL;
ALTER TABLE ac_key_GridPP_DataOperation_User MODIFY value VARCHAR(64) NOT NULL;
ALTER TABLE ac_in_GridPP_Job MODIFY User VARCHAR(64) NOT NULL;
ALTER TABLE ac_in_GridPP_Job MODIFY Site VARCHAR(64) NOT NULL;
ALTER TABLE ac_key_GridPP_Job_User MODIFY value VARCHAR(64) NOT NULL;
ALTER TABLE ac_key_GridPP_Job_Site MODIFY value VARCHAR(64) NOT NULL;
ALTER TABLE ac_in_GridPP_Pilot MODIFY Site VARCHAR(64) NOT NULL;
ALTER TABLE ac_in_GridPP_Pilot MODIFY User VARCHAR(64) NOT NULL;
ALTER TABLE ac_key_GridPP_Pilot_Site MODIFY value VARCHAR(64) NOT NULL;
ALTER TABLE ac_key_GridPP_Pilot_User MODIFY value VARCHAR(64) NOT NULL;
If you don't want to switch to the new FTS3 system, the FTSDB should be changed accordingly to what follows, especially if you want to accommodate the stricter MySQL 5.7 requirements:
USE FTSDB;
ALTER TABLE FTSFile MODIFY Error VARCHAR(2048);
ALTER TABLE FTSJob MODIFY Error VARCHAR(2048);
ALTER TABLE FTSJob MODIFY FailedSize BIGINT;
Two stored procedures need to be recreated BEFORE updating to MySQL 5.7: ps_delete_files and ps_delete_replicas_from_file_ids. For this, from the DIRAC/DataManagementSystem/DB/FileCatalogWithFkAndPsDB.sql
, for each of the two procedures, copy the whole PL/SQL code chunk, and copy paste it in MySQL
DROP PROCEDURE IF EXISTS [...]
[...]
END //
DELIMITER ;
To accommodate the stricter MySQL 5.7:
use ReqDB;
ALTER TABLE Request MODIFY Error VARCHAR(2048);
ALTER TABLE Operation MODIFY Error VARCHAR(2048);
ALTER TABLE File MODIFY Error VARCHAR(2048);
For compatibility with MySQL 5.7, the FTSHistoryView needs update:
alter view FTSHistoryView as select `FTSJob`.`Status` AS `Status`,sum(`FTSJob`.`Files`) AS `Files`,`FTSJob`.`TargetSE` AS `TargetSE`,(sum(`FTSJob`.`Completeness`) / count(distinct `FTSJob`.`FTSJobID`)) AS `Completeness`,sum(`FTSJob`.`FailedSize`) AS `FailedSize`,sum(`FTSJob`.`Size`) AS `Size`,sum(`FTSJob`.`FailedFiles`) AS `FailedFiles`,count(distinct `FTSJob`.`FTSJobID`) AS `FTSJobs`,`FTSJob`.`SourceSE` AS `SourceSE` from `FTSJob` where (`FTSJob`.`LastUpdate` > (utc_timestamp() - interval 3600 second)) group by `FTSJob`.`SourceSE`,`FTSJob`.`TargetSE`,`FTSJob`.`Status` ;