Hi
I’m testing pt-osc against a Mysql instance on Google Cloud Sql, version 8.0.18-google. The table has foreign keys and I have testet with the “–alter-foreign-keys-method auto” but I get an error regarding the drop_swap option.
--alter-foreign-keys-method=drop_swap doesn't work with MySQL 8.0+
See https://bugs.mysql.com/bug.php?id=89441
Regarding the bug report this should be fixed in 8.0.14! I’m not into the details around the problem, so can anyone confirm that this i still a problem with MySQL 8.0+ and will be throughout the 8.0+ life or is this due to the google version?
In the case where I’m forced to use “–alter-foreign-keys-method rebuild_constraints", as stated in the doc, this could take long time for large table. So my question here is, are the altered child tables locked during this process?
Hi @Storebuddy, honestly, best way to confirm if a bug is fixed is to try it yourself. In theory, google’s 8.0.18 should include fixes from 8.0.14. You should be able to easily clone your instance and test it out on the new clone. Delete clone when done. Should not cost too much for peace of mind vs testing in production.
The child tables will most likely have a READ/SHARED lock imposed on each row during the index rebuild.
Looking at the Percona Toolkit source code on GitHub:
if ($vp->cmp('8.0') > -1 && $vp->flavor() !~ m/maria/i && $alter_fk_method eq 'drop_swap') {
my $msg = "--alter-foreign-keys-method=drop_swap doesn't work with MySQL 8.0+\n".
"See https://bugs.mysql.com/bug.php?id=89441";
_die($msg, INVALID_PARAMETERS);
}
To me the issue is that the toolkit does not adknowledge that bug is addressed in 8.0.14 and above.