I’m trying to upgrade a mySQL read-replica from 5.6 to 5.7. The replica has zero lag time, and near 1% CPU usage. I kicked off the upgrade command via console this morning at 945. It has been stuck on 0% for its pre-upgrade snapshot for hours now. This instance size is a t3.medium.
Looking at the upgrade logs, it has been doing things, but it also just looks like it’s dead in the water. The snapshot started creating at 245 (so almost an hour ago as I type this), yet its still at 0%.
Is it just taking it’s sweet time because of how small the instance is? Or is it possible that there is an underlying problem with the replica that isn’t visible via console?
The upgrade from 5.6 to 5.7 has pitfalls - especially to time/date fields. Did you perform the FORCE’d table upgrades prior to upgrading? Detailed here…
If not, then the upgrade can take a very very long time indeed - depending on how much data you have in - you can expect multiple days if you have a lot (eg: several tables with 10million+ records subject to high use / locking transctions).
If you can’t wait, I’d suggest deleting the replica, creating a new one & follow the full guide in link above.
We’ve done a test against larger databases in dev/test before and had no issues. Those databases perform the upgrade on m5.larges or bigger.
RE: FORCE commands - the RDS upgrade process does that for us. In previous testing, it shows that each table receives the ALTER TABLE <table_name> FORCE; and then gives a “upgrade successful”.
I’m leaning towards deleting this replica and starting over. I see that under databases > replica that is upgrading > maintenance & backups that under “Snapshot creation time” it shows:
"Invalid date UTC-7 (local) Region(N.California): Invalid Date UTC-8 "
Almost seems like RDS is just spinning wheels on this.
You can try the console, and see if you can cancel/restart the upgrade.
Another option is to create a new read replica based on the 5.7 and switch your app to read from the new replica. Eventually, you can even rename the new replicate to the old name after you delete the old replica.
Via console there is no cancel / restart feature via action drop down that I can use.
And to your second idea - If I am understanding what you’re saying, we can’t really do that. The upgrade on the replica has to be completed successfully prior to pointing the app to it.
We’ve done a test against larger databases in dev/test before and had no issues. Those databases perform the upgrade on m5.larges or bigger.
Did you have a full load simulation running? I’m not sure previous upgrades are a good indicator for the 5.6->5.7 upgrades - at least from my experience, all mileage varies ofc. For us previous upgrades have also been OK, this one was not all - took quite a bit of planning and time to assess. Applying real world load for testing made a big difference to the end result.
Just a quick note on the FORCE’d table upgrade point - you’re right ofc the AWS upgrade script (which is actually just the mysql upgrade script as I understand it) performs these necessary steps. But for whatever reason on RDS (& our experience bears this out) it’s a lot faster if you do it in advance (and you can stagger them to reduce impact of locked tables etc.) …which is why AWS recommend it. From the docs page I linked to…
If your DB instance runs a version before MySQL version 5.6.4, or was upgraded from a version before 5.6.4, we recommend an extra step. In these cases, we recommend that you convert the datetime, time, and timestamp columns in your database before upgrading your DB instance to MySQL version 5.7. This conversion can significantly reduce the amount of time required to upgrade the DB instance to MySQL version 5.7.
Sorry I misunderstood what you were meaning by that, yea we are just letting RDS to handle all the ‘heavy lifting’ without needing to do it ourselves. Based on the logging I saw from when I did it in test, there were hundreds of tables it ran the alter against.
What’s weird though, is that on much larger databases, the upgrade took maybe an hour from start to finish.
We did testing across most of our environments, thinking that testing against the smaller instance wouldn’t be necessary (naive of us i know ). This database itself is significantly smaller than the rest.
You can have multiple read replicas. Basically, from your master, create ANOTHER read replica. When you do so, you will have the option to select 5.7. Once you have both read replicas up and running, switch your app to the new replica: zero downtime and the best way to do any read-replica upgrades.