This post is one part of a series discussing the OpenStack Nova Juno mid-cycle meetup. It’s a bit shorter than most of the others, because the next thing on my list to talk about is DB2, and that’s relatively contained.
IBM is interested in adding DB2 support as a SQL database for Nova. Theoretically, this is a relatively simple thing to do because we use SQLAlchemy to abstract away the specifics of the SQL engine. However, in reality, the abstraction is leaky. The obvious example in this case is that DB2 has different rules for foreign keys than other SQL engines we’ve used. So, in order to be able to make this change, we need to tighten up our schema for the database.
The change that was discussed is the requirement that the UUID column on the instances table be not null. This seems like a relatively obvious thing to allow, given that UUID is the official way to identify an instance, and has been for a really long time. However, there are a few things which make this complicated: we need to understand the state of databases that might have been through a long chain of upgrades from previous Nova releases, and we need to ensure that the schema alterations don’t cause significant performance problems for existing large deployments.
As an aside, people sometimes complain that Nova development is too slow these days, and they’re probably right, because things like this slow us down. A relatively simple change to our database schema requires a whole bunch of performance testing and negotiation with operators to ensure that its not going to be a problem for people. It’s good that we do these things, but sometimes it’s hard to explain to people why forward progress is slow in these situations.
Matt Riedemann from IBM has been doing a good job of handling this change. He’s written a tool that operators can run before the change lands in Juno that checks if they have instance rows with null UUIDs. Additionally, the upgrade process has been well planned, and is documented in the specification available on the fancy pants new specs website.
We had a long discussion about this change at the meetup, and how it would impact on large deployments. Both Rackspace and HP were asked if they could run performance tests to see if the schema change would be a problem for them. Unfortunately HP’s testing hardware was tied up with another project, so we only got numbers from Rackspace. For them, the schema change took 42 minutes for a large database. Almost all of that was altering the column to be non-nullable; creating the new index was only 29 seconds of runtime. However, the Rackspace database is large because they don’t currently purge deleted rows, if they can get that done before running this schema upgrade then the impact will be much smaller.
So the recommendation here for operators is that it is best practice to purge deleted rows from your databases before an upgrade, especially when schema migrations need to occur at the same time. There are some other takeaways for operators as well: if we know that operators have a large deployment, then we can ask if an upgrade will be a problem. This is why being active on the openstack-operators mailing list is important. Additionally, if operators are willing to donate a dataset to Turbo-Hipster for DB CI testing, then we can use that in our automation to try and make sure these upgrades don’t cause you pain in the future.
In the next post in this series I’ll talk about the future of cells, and the work that needs to be done there to make it a first class citizen.