buttonmen-dev / buttonmen

Buttonmen - an online dice game
Other
16 stars 24 forks source link

Use mysql-8.0 for the site #2960

Closed cgolubi1 closed 2 months ago

cgolubi1 commented 3 months ago

When this is ready to merge, it will fix #2928

I think there are several remaining pieces here:

  1. Gain confidence that i understand how to maintain database access across this upgrade
  2. Rough edges or bugs that need to be addressed
  3. Replay testing
  4. Dev testing

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:

blackshadowshade commented 3 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.

cgolubi1 commented 3 months ago

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.]

cgolubi1 commented 3 months ago

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.

cgolubi1 commented 3 months ago

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:

dwvanstone commented 3 months ago

I changed preferences, added to the forums, searched the corners of history, created a game, took a turn in a game ... everything looks good!

cgolubi1 commented 3 months ago

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.

cgolubi1 commented 2 months ago

Recapping next steps:

cgolubi1 commented 2 months ago

Modifying 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.

cgolubi1 commented 2 months ago

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.

dwvanstone commented 2 months ago

The tires have been successfully kicked. Everything looks good so far!

cgolubi1 commented 2 months ago

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.

cgolubi1 commented 2 months ago

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.

dwvanstone commented 2 months ago

Tires kicked some more and seem fine.

cgolubi1 commented 2 months ago

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.

blackshadowshade commented 2 months ago

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?

cgolubi1 commented 2 months ago

Here's the gist of what the new/changed files do, if it helps:

blackshadowshade commented 2 months ago

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.