[MDEV-31345] Data loss is happened while migrating the database from mysql5.7.42 to mariadb10.3.39 Created: 2023-05-25 Updated: 2023-06-13 Resolved: 2023-06-07 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Backup, Replication, Server |
| Affects Version/s: | 10.3.39 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Critical |
| Reporter: | Poovendhiran | Assignee: | Daniel Black |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | Compatibility, corruption, crash | ||
| Environment: |
Mysql 5.7.42 in ubuntu18.04 |
||
| Description |
|
Hello Team, We are planned to upgrade the OS from ubuntu 18.04 to ubuntu 20.04. In the same server we have the mysql-5.7.42 DB(Dedicated). As part of ubuntu upgrade we planned to migrate the database also from mysql to mariaDB(Because of some application dependencies). So , after the upgrade we have installed the mariadb and tried to restore the backup . Restoration is completed successfully. But we found there are some data loss happened during the restoration(Based on the row count)
Kindly help me on this, this is a very critical one because ubuntu18.04 is going to stop their support by 31May. |
| Comments |
| Comment by Poovendhiran [ 2023-05-25 ] |
|
Hello Team, Please |
| Comment by Daniel Black [ 2023-05-25 ] |
|
The table_rows in the information_schema.TABLE for innodb is purely and estimate. I doubt you are missing actual rows. The estimate gather by the different implementation, or even different server depending on how they are loaded can generate significant differences of the order of magnitude presented here. Check using the slower SELECT COUNT While focal does have a 10.3 version, as far as upstream here is concerned its eol. I recommend bumping to the jammy 10.6 version to ensure a common distro and upstream maintaince. |
| Comment by Poovendhiran [ 2023-05-26 ] |
|
Hello @Daniel Black, Thank you very much for your valuable points. Yes, we have checked row counts in all tables. That also given different result. And even database size also differed from mysql.In mysql the total size of the DB is 9.4GB but in restored mariadb the database size is 8.7GB. Additionally , I will try with Maria DB 10.6 (Jammy ) and I will update you back. Thanks once again. |
| Comment by Poovendhiran [ 2023-05-26 ] |
|
Hello @Daniel Black, I have tried with mariadb10.6. But there is no luck, same issue in mariadb10.6 also. |
| Comment by Daniel Black [ 2023-05-26 ] |
|
How are you doing the backup/restore? The size on disk can be naturally smaller on a logical restore. What table content method is being used to determine accuracy of migration? I see you've marked Replication - is the 10.6 instance a replica of the 5.7 master? If so pt-table-sync can check and fix replica consistency. |
| Comment by Poovendhiran [ 2023-05-26 ] |
|
Basically I'm migrating from mysql5.7 to mariadb . The total number of rows in tables is differ in mysql and mariadb. For mysql backup used below command: To restore that mysql dump in maria DB , I have used below query.(After logging into mariadb used below query to restore) I have used below query to check the total number of rows in a table |
| Comment by Poovendhiran [ 2023-05-29 ] |
|
Hello Team, Please update on this, this case is now getting serious as Ubuntu 18.04 support is going to terminate its support by 31 Maay 2023(EOL). |
| Comment by Daniel Black [ 2023-05-29 ] |
|
Are you willing to share your dump privately for testing on our ftp service? |
| Comment by Poovendhiran [ 2023-05-30 ] |
|
Hello Daniel, As this is a production environment , I cannot share the dump to outside. If possible can we connect and discuss? |
| Comment by Daniel Black [ 2023-06-07 ] |
|
Can you import the data into a fresh 5.7 instance and verify the counts match those from the origin? How do they compare to the mariadb instance? Can you include SHOW GLOBAL STATUS and SHOW ENGINE INNODB STATUS from the MySQL-5.7 and MariaDB-10.6 side by side after the install? If still differences; Are the primary/unique keys of tables of text/char/varchar types of differing collations? |
| Comment by Poovendhiran [ 2023-06-07 ] |
|
Hello Daniel, Thanks for your concerns, This issue got resolved.The information_schema gives the assumed values of row_counts. We need to check the row counts for each tables using select count |
| Comment by Daniel Black [ 2023-06-07 ] |
|
Great to hear. Wishing you a stable migration when the time comes. |
| Comment by Poovendhiran [ 2023-06-13 ] |
|
Hello @Daniel Black, Thanks for your valuable points. We have done the migration without any issues. |