Closed cgolubi1 closed 2 months ago
I've played a couple of turns, made a post in a forum, created a new test thread, done a search in History. All looks good.
Thanks for checking. I can't login now, because mysqld got killed, and then got killed again on restart.
Looking at metrics, i strongly suspect these are OOM kills, and that MySQL-8.0 just needs more memory than MySQL-5.7. (We might be able to mitigate that by tweaking something, but one thing at a time.)
[No advice needed on this atm; i have my next set of steps. Just commenting so other people who might try the dev site won't be surprised when they can't login.]
After increasing memory from 512Mb to 1024Mb, i was able to kick off replay testing right away. Let's let that run for awhile and see how it does.
I rebuilt the dev site, but i had to load the database again after build, because mysqld hadn't finished starting up at the point that the script tried to load it. So:
I changed preferences, added to the forums, searched the corners of history, created a game, took a turn in a game ... everything looks good!
Thanks, dwvanstone. I'm going to tear down and rebuild the dev site a few times to try to reproduce the issue where it takes mysql awhile to start up and thus the post-install database load fails.
Recapping next steps:
mysql_apt_config.dat.erb
that i flagged earlier, and see if that gets away from having to install mysql's init.d script by handModifying the apt config script didn't seem to change anything; i still have to manually install an init script. Weird, but i don't have a good thought about what to do about it, so i'm going to not worry.
Okay, i think https://2928-mysql-80.cgolubi1.dev.buttonweavers.com/ui/index.html is now using a mysql-8.0 client to talk to the remote mysql-5.7 RDS server. This is good to know if it works, because if it does, we can do the deployment with less downtime, by first pushing the new client and then upgrading the database. So i'm going to let that run for awhile, and if folks could kick the tires a bit, that'd be great.
The tires have been successfully kicked. Everything looks good so far!
Okay, so backups don't work with an 8.0 client and a 5.7 DB:
$ sudo /usr/local/bin/backup_buttonmen_database
mysqldump: Couldn't execute 'SELECT COLUMN_NAME, JSON_EXTRACT(HISTOGRAM, '$."number-of-buckets-specified"') FROM information_schema.COLUMN_STATISTICS WHERE SCHEMA_NAME = 'buttonmen' AND TABLE_NAME = 'button';': Unknown table 'COLUMN_STATISTICS' in information_schema (1109)
That's not worth figuring out; i'm just looking for an order of operations. It seems like the site works as far as we can tell, and that should be good enough.
Okay! I've now upgraded the RDS site used by https://2928-mysql-80.cgolubi1.dev.buttonweavers.com/ui/index.html from:
After these changes, i successfully:
Can other folks kick the tires on the site again now? If this looks good, i'm going to put this up for PR.
Tires kicked some more and seem fine.
Thanks! I'm marking this ready to be reviewed for merge, and if it looks good, we'll deploy it out to staging and prod next weekend.
I can confirm that we have files that are only to do with the deployment, rebased into a single commit. The files look reasonable, but I must admit to being unable to adequately review the new mysql configuration and delaying stuff.
Is there someone else who can run their eyes over the new code here and give some meaningful feedback? @irilyth?
Here's the gist of what the new/changed files do, if it helps:
create_databases.erb
: mysql-8.0 treats users as separate first-class entities, instead of just being a side effect of grants. so when we create databases from scratch for local sites, we have to create the users if they don't exist, and then grant them to the databases separately. (for RDS, the upgrade process takes care of this for us, so we don't have to do anything.)mysql/manifests/init.pp
: install all the new files (more about them below). Run the custom script configure_mysql_apt
before trying to install mysql-server or mysql-client. Use some extra flags (--allow-unauthenticated
and -f
) when using apt to install mysql software, because the configuration we're using to get mysql-8.0 requires those flags. (This isn't 100% ideal, but it's basically fine; it's a side effect of the APT repo i was able to find which allowed us to install mysql-8.0 on our ancient Ubuntu version, so all of that's a bit hackish, but IMO the right answer is to make a plan to upgrade our Ubuntu version in the nearish future rather than worry too much about this step.)buttonmen.cnf.erb
: changes to SQL parameters mysql-8.0 supports. I think you know as much about these as i do. The setting of default-authentication-plugin
is to allow us to continue to use passwords for connection as we do under mysql-5.7, as that's no longer the default under mysql-8.0.configure_mysql_apt.erb
: a custom script which downloads APT configuration for mysql-8.0 that works on our OS from dev.mysql.org, then installs that APT configuration using some custom system config settings (more below), then runs apt-get update
so future installation activities will use the new versions. The purpose of this script is to override our OS default of mysql-5.7 when installing packages, so that we're able to install mysql-8.0 using mostly-normal apt commands.mysql_apt_config.dat.erb
: apt settings which say we would prefer mysql-8.0. apt-config installs these. I think for all this apt version configuration stuff, you can take the fact that this works (when we install containers with this code, those containers come up with mysql-8.0) as proof that it's syntactically reasonable, if that makes sense.init_mysql.erb
: the one thing this new stuff doesn't seem to do is install /etc/init.d/mysql
, which is the script needed to launch mysqld at container startup. I don't really understand why not, but i copied this one from our mysql-5.7 installation, and, again, the fact that it works is proof that it works. (Also note that we only run mysqld on dev sites, not on staging or prod, so if this goes totally wrong, it can't break staging and prod, which only need mysql-client.)Okay, let's give this a go. The one file that I was somewhat uncertain about was the init_mysql.erb, and the fact that breaking mysqld doesn't affect staging or prod means I'm much happier with not exactly understanding what's going on there.
When this is ready to merge, it will fix #2928
I think there are several remaining pieces here:
Database access across upgrade, notes:
Rough edges:
Anyway, all of that notwithstanding, the reason i'm putting up the draft PR is so we can get some replay and dev testing: