[All][Neutron] Migrate old DB migration versions to init ops

Rodolfo Alonso Hernandez ralonsoh at redhat.com
Wed Jun 24 13:20:16 UTC 2020

Hello all:

Along this years we have increased the number of DB migrations each time we
needed a new DB schema. This is good because that means the project is
evolving and adding new features.

Although this is not a problem per se, there are some inconvenients:
- Every time a system is deployed (for example in the CI using devstack),
the initial DB schema is created. Then, each migration is applied
- Some FT tests are still checking the sanity of some migrations [1]
implemented a few releases ago.
- We are still testing the contract DB migrations. Of course, this is
something supported before and we still need to apply those revisions.
- "TestWalkMigrationsMysql" and "TestModelsMigrationsMysql", both using
MySQL backend, are still affected by LP#1687027.

The proposal is to remove some DB migrations, starting from Liberty; of
course, because all migrations must be applied in a specific order, we
should begin from the initial revision, "kilo". The latest migration to be
removed should be decided depending on the stable releases support.

Apart from mitigating or solving some of the commented problems, we can
"group" the DB model definition in one place. E.g.: "subnetpools" table is
created in "other_extensions_init_ops". This file contains the first table.
However is modified in at least two migrations:
- 1b4c6e320f79_address_scope_support_in_subnetpool: added
"address_scope_id" field
- 13cfb89f881a_add_is_default_to_subnetpool: added "is_default" field

Instead of having (at least) three places where the "subnetpools" DB schema
is defined, we can remove the Mitaka migration and group this definition in
just one place.

One possible issue: some migrations add dependencies on other tables. That
means the table the dependency is referring should be created in advance.
That implies that, in some cases, the table creation order should be
modified. That should never affect subsequent created tables or migrations.

Do you see any inconvenience on this proposal? Am I missing something that
I didn't consider?

Thank you and regards.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-discuss/attachments/20200624/cc060fc6/attachment.html>

More information about the openstack-discuss mailing list