A good chunk of current migrations apply only to certain plugins making them configuration-dependent. A migration path dependent on configuration poses a serious upgrade problem. The Neutron DB is being restructured in a way that the DB schema will always be the same regardless of Neutron’s configuration. For this reason, logic for handling configuration-dependent migrations should go; similarly configuration dependent migrations should be made ‘independent’. Possibly they should also be squashed so that by reducing the overall number of migration we might be able to speed up DB ugrade process.
The work described in this blueprint relies on the Neutron DB healing blueprint, whose spec can be found at: https://review.openstack.org/95738/
There are currently over 100 migrations in Neutron’s DB upgrade path. A migration often applies only to certain plugins, and is skipped if currently neutron is configured with a different plugin. This creates a serious upgrade problem.
As an example, the devstack job for Neutron for testing an upgrade from havana to icehouse fails because the ‘metering’ service plugin is specified only in the icehouse configuration; however since it was introduced in havana, some fundamental migrations to make it work where skipped. Hence the upgrade fails as soon as the first migration touching metering DB models is encountered.
This problem is already being dealt with by “healing” neutron DB schema in a way such that its end state will be the same regardless of conf values.
Nevertheless, there a few more things to take care of:
The proposed change is rather simple: remove the logic for skipping migrations according to the current configuration, and make all migrations “global”.
As this blueprint looks back at the whole migration history, which stretches back to folsom, this is also a good chance to coalesce this rather long path by squashing intra-release migrations together, and removing from the path versions which are now not anymore supported.
For instance, the revised path could: 1) Start at Havana Release
3) Resume the ‘traditional’ path from Icehoue up to trunk, ensuring that all migrations in this path become however configuration-independent
This new migration path MUST ensure correct operation of upgrade/downgrades from Havana to Icehouse. To this aim, this change will introduce:
NOTE: If there is consensus to keep allowing users running unsupported releases to upgrade to Icehouse directly then initial statuses for Folsom and Grizzly might be kept.
One alternative would be to leave everything as it is at the moment, and add a test (integrated with flake8) to prevent new plugin-dependent migrations from being added to the path; Also the check for asessing whether a migration should be executed or skipped will be bypassed.
This should work, but it will still leave us with a lot of plugin-specific migrations which might confuse users. Also, there will be leftover, unused code in the source tree which will eventually end up bitrotting.
The migration path up to Havana will be removed. This can be substituted with Grizzly if there is an agreement to provide users running the now unsupported Grizzly to uprade to a more recent release.
Intra-release migrations between Havana and Icehouse (and possibly between Grizzly and Havana) will be squashed into a single migration.
If migrations are squashed, upgrade will obviously be faster. No impact for runtime performance.
Operators which already already running havana should be able to upgrade to icehouse without any problem.
For operators running Icehouse, Havana downgrade should be smooth, both if they executed or not already the ‘healing’ migration.
Operators running versions prior to Havana might still be supported, if versions older than Havana are kept in the migration path.
It will be no longer possible to create plugin-specific migrations.
In rough terms we might expect a first step where the migration logic is removed, and all migrations made independent of configuration. In a second step instead a new initial state will be defined and intra-release migrations prior to Icehouse will be squashed.
Even if these work items are not orthogonal, dependencies among them are not necessarily represented by the order in which appear in this document.
DB migration refactoring is a prerequisite for this blueprint. https://review.openstack.org/#/c/95738/
No additional tests should be added. Instead, some unit tests concerning plugin-specific migrations might be removed.
Existing grenade tests should be enough to validate the new upgrade path.