[RFE] Add new ironic-dbsync command online_data_migrations
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ironic |
Fix Released
|
Wishlist
|
Ruby Loo |
Bug Description
This is a command to do online data migration while the ironic services are running. This is the final step to be done, after the rolling upgrade work of https:/
This command is very similar to nova's "nova-manage db online_
The command: ironic-dbsync online_
Perform online data migrations for the release, in batches. By default (unless max-count is specified), the migrations are done in batches of 50 objects, until all the objects have been migrated.
If --max-count is specified, it is the maximum number of objects to migrate in this call. It must be a positive integer; otherwise 127 is returned.
Returns 0 if all the objects have been migrated and there is nothing more to do. Otherwise returns 1.
Developers will have to add their data migrations to this script, as well as avoid or postpone incompatible schema changes to the next release.
Documentation will be added with instructions on how to write the migration scripts as well as when and how to do incompatible changes, checking that all data was migrated to the newest format before removing unused columns and tables.
Example of a change which requires online data migration:
FromVer Node Object is 1.15, ToVer Node object is 1.16 with a new field 'fake' and deprecate 'extra' field.
The rolling upgrade process will involve:
1. Updating the schema with the new column
2. Running services with the new version, pinned, which still saves data in an old format:
db_node['version'] == '1.15', db_node['fake'] is None, and db_node['extra'] contain values.
3. When this new version is unpinned, it starts saving records in a new version format:
db_node['version'] == '1.16', db_node['fake'] contain values, and db_node['extra'] is None,
but some 'untouched' rows still contain data in the old format, these are rows which weren't updated at run-time.
4. To make sure everything is converted, online schema migrations are run
NEXT RELEASE
5. A contraction script is added, to remove the old, unused 'extra' column.
The contraction script must check if all data is in the new version before removing the old column. For example, it can make sure that SELECT count(*) node WHERE version = '1.15' returns 0.
If it returns something other then 0, it should return with an error with information about running the online_
Changed in ironic: | |
assignee: | nobody → Tan Lin (tan-lin-good) |
Changed in ironic: | |
importance: | Undecided → Wishlist |
Changed in ironic: | |
status: | New → Confirmed |
tags: | added: rolling-upgrades |
description: | updated |
description: | updated |
Changed in ironic: | |
assignee: | Grzegorz Grasza (xek) → Szymon Borkowski (szymon-borkowski) |
Changed in ironic: | |
assignee: | Szymon Borkowski (szymon-borkowski) → Grzegorz Grasza (xek) |
Changed in ironic: | |
assignee: | Grzegorz Grasza (xek) → Szymon Borkowski (szymon-borkowski) |
Changed in ironic: | |
assignee: | Szymon Borkowski (szymon-borkowski) → Ruby Loo (rloo) |
I don't think this requires a spec, but we're still working on the rolling-upgrades spec: https:/ /review. openstack. org/299245.
Tan Lin is no longer working on this, I'm going to assign it to Grzegorz in the mean time.