Details
-
Epic
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
Description
This is a list of things that needs to do if we would like to provide an 'Easy upgrade' from MySQL 8.0 to MariaDB.
1) Using mysqldump
- This patch should be done in any case, as it should always work independent
of future changes in MySQL. - Create a script / program to be run before taking down MySQL
- Start by scanning all MySQL tables and ensure that the tables can be
moved to MariaDB. - The script would invoke mysqldump with the optimal options to create
fastest possible dump & restore, for example using -T (create a tab
separated file for each table). - If using -T, enhance mysqldump to be combine -T an --all-databases
- In this case we should store data in 'database/tablename'
- Optionally add a mysqldump option for compressing datafile after
it was created (in MariaDB we could also add the option to the server). - Add an option to LOAD DATA to support reading compressed files
(gzip header could be detected automatically) - Ensure we can dump system tables in a format usable by MariaDB.
After running the script, there are two options for the end user:
- Take down MySQL and install MariaDB.
- Copy the 'table dump' to another machine with MariaDB installed. This
could later be put as a slave for the original MySQL version. - We should create another script to safely read the dumped tables
into MariaDB. This could add addition checking/work to ensure that
all system tables are converted properly.
2) In place conversion of MySQL 8.0 to MariaDB
- Take down MySQL (cleanly!) and install MariaDB.
- Start script/program to handle MariaDB to MySQL upgrade
- Some part of the logic, like changing system tables to MariaDB, could
be done by an external script. To be decided later
Problems to fix:
- Handling MySQL partition tables (same problem as in MySQL 5.7 -> MariaDB) (fixed)
- MySQL new extended timestamp
- Ensure that InnoDB can start with MySQL ib_logfiles (maybe these has to
be automatically recreated, but should not be a problem if a clean shutdown
was done). - Create .frm files for each table from the MYSQL system tables.
- Can be done by using the system tables to generate a CREATE TABLE statement
(such a program already exists) and use MariaDB internals to create an
.frm file (most code already exists in MariaDB) - Loop over all InnoDB tables and convert them to MariaDB format.
The known compatibility issues with InnoDB in MySQL and MariaDB:
- Different log formats (should not be a problem in case of clean shutdown)
- Different InnoDB tablespace / table format (generally)
- Different InnoDB row format when instant alter table was used to add, drop
or swap columns. There may also be difference when adding/dropping keys. - If it would be 'close to impossible' to convert these, one option would be
to run a script on the original MySQL server to do a full table rebuild
with ALTER TABLE for all tables. This would remove all versioned rows
from the InnoDB tables.
The above can of course be done on a MySQL slave and after the conversion is
done it should be used to catch up with all data changes before retiring MySQL.
Attachments
Issue Links
- is part of
-
MDEV-28906 MySQL 8.0 desired compatibility
- Open
- relates to
-
MDEV-23630 mysqldump to logically dump system tables
- Closed