Page MenuHomePhabricator

Fix 'openstack database instance rebuild'
Closed, ResolvedPublic

Description

Right now trove instances are stuck in time with whatever config and setup was the default when they were created. In theory upgrading and/or rebuilding instances will allow the config and dependencies to be updated without loss of data.

Right now rebuilding fails because it relies on nova's rebuild feature, which we have disabled.

Event Timeline

Change 992543 had a related patch set uploaded (by Andrew Bogott; author: Andrew Bogott):

[operations/puppet@production] nova policy: add awareness of 'unmanaged' role

https://gerrit.wikimedia.org/r/992543

Change 992543 merged by Andrew Bogott:

[operations/puppet@production] nova policy: add awareness of 'unmanaged' role

https://gerrit.wikimedia.org/r/992543

Rebuilding now works fairly reliably for mariadb and mysql -- the only hitch I've run into is disagreement about where to mount the cinder volume (this seems to oscillate for each Ubuntu release, sometimes being /dev/sdb and /dev/vdb.)

Postgres rebuilds do not work at all with upstream code. I've proposed a fix for this:

https://review.opendev.org/c/openstack/trove/+/923787

If that gets a favorable upstream response I'll bake a new guest image that supports it.

I'm seeing puzzling behavior with this. With some trove instances (e.g. test VMs) rebuild acts as I expected: the old VM is fully replaced with a new one and re-instrumented to replace the old one. Good!

I then tested with a couple of 'real' dbs, harbor (in toolsbeta) and metrics-infra. In both cases the rebuild process went through the motions but the end result was the same instance as before the rebuild. It /says/ that it's been upgraded to Jammy but it's actually still Bionic.

I tried pulling Trove out of the loop and rebuilding directly with nova, and saw the same weird behavior. Sometimes it rebuilds, sometimes it does not. So that needs investigation before we can move forward.

I have a clue! I think that rebuild misbehaves when there are active snapshots of a VM. On my first test, this seems to have made it work:

rbd snap purge --pool eqiad1-compute c27abddd-8330-43db-80a9-dafebc76fc79_disk

Change #1054912 had a related patch set uploaded (by Andrew Bogott; author: Andrew Bogott):

[cloud/wmcs-cookbooks@main] Add rebuild_dbinstance cookbook

https://gerrit.wikimedia.org/r/1054912

Change #1054912 merged by Andrew Bogott:

[cloud/wmcs-cookbooks@main] Add rebuild_dbinstance cookbook

https://gerrit.wikimedia.org/r/1054912

There's now a cookbook for this which so far seems to be working.