Remove pre-upgrade best-effort online data migrations

The best effort pre-upgrade online data migrations were an attempt to
mitigate possible user errors if users forget to run the online data
migrations explicitly during the previous upgrade. However, they ended
up causing more problems than good:

* If user follows docs, they are unnecessary.

* If the containers for the services aren't running, they will get
  silently ignored already. This was done to facilitate re-runs of
  failed upgrade steps and prevent false failures. If the upgrade
  includes an operating system change, the pre-upgrade migrations will
  simply not run.

* However, if the containers for the services are running but the
  database is not running or is not functional for some reason, the
  migration will be attempted and the upgrade will get stuck. This
  leads to confusing errors not really related to the root cause of
  the problem, and non-straightforward breakages where the fix might
  otherwise be just to re-run the upgrade.

For the above reasons this commit removes the pre-upgrade just-in-case
online data migrations. We should be running them only as documented
in the upgrade workflow.

Change-Id: I5d3cc863f138d4f1a915e8a2060dd9ed1d577f37
Closes-Bug: #1841590
(cherry picked from commit cd23d2054e)
This commit is contained in:
Jiri Stransky 2019-08-27 15:05:54 +02:00
parent 96443f9c47
commit c992964f10
3 changed files with 0 additions and 51 deletions

View File

@ -353,23 +353,6 @@ outputs:
Log files from cinder containers can be found under
/var/log/containers/cinder and /var/log/containers/httpd/cinder-api.
ignore_errors: true
upgrade_tasks:
- when: step|int == 0
tags: common
block:
- name: set is_cinder_api_bootstrap_node fact
set_fact: is_cinder_api_bootstrap_node={{cinder_api_short_bootstrap_node_name|lower == ansible_hostname|lower}}
- name: Ensure all online data migrations for Cinder have been applied
shell: |
if {{ container_cli }} ps | grep cinder_api; then
{{ container_cli }} exec cinder_api cinder-manage db online_data_migrations
# handle situation when container_cli is podman but
# the containers are still under docker
elif docker ps | grep cinder_api; then
docker exec cinder_api cinder-manage db online_data_migrations
fi
tags: pre-upgrade
when: is_cinder_api_bootstrap_node|bool
post_upgrade_tasks:
- when: step|int == 1
import_role:

View File

@ -277,23 +277,6 @@ outputs:
Log files from ironic containers can be found under
/var/log/containers/ironic and /var/log/containers/httpd/ironic-*.
ignore_errors: true
upgrade_tasks:
- when: step|int == 0
tags: common
block:
- name: set is_ironic_api_bootstrap_node fact
set_fact: is_ironic_api_bootstrap_node={{ironic_api_short_bootstrap_node_name|lower == ansible_hostname|lower}}
- name: Ensure all online data migrations for Ironic have been applied
shell: |
if {{ container_cli }} ps | grep ironic_api; then
{{ container_cli }} exec ironic_api ironic-dbsync --config-file /etc/ironic/ironic.conf online_data_migrations
# handle situation when container_cli is podman but
# the containers are still under docker
elif docker ps | grep ironic_api; then
docker exec ironic_api ironic-dbsync --config-file /etc/ironic/ironic.conf online_data_migrations
fi
tags: pre-upgrade
when: is_ironic_api_bootstrap_node|bool
external_upgrade_tasks:
- when: step|int == 1
block:

View File

@ -467,23 +467,6 @@ outputs:
metadata_settings:
get_attr: [ApacheServiceBase, role_data, metadata_settings]
host_prep_tasks: {get_attr: [NovaApiLogging, host_prep_tasks]}
upgrade_tasks:
- when: step|int == 0
tags: common
block:
- name: set is_nova_api_bootstrap_node fact
set_fact: is_nova_api_bootstrap_node={{nova_api_short_bootstrap_node_name|lower == ansible_hostname|lower}}
- name: Ensure all online data migrations for Nova have been applied
shell: |
if {{ container_cli }} ps | grep nova_api; then
{{ container_cli }} exec nova_api nova-manage db online_data_migrations
# handle situation when container_cli is podman but
# the containers are still under docker
elif docker ps | grep nova_api; then
docker exec nova_api nova-manage db online_data_migrations
fi
tags: pre-upgrade
when: is_nova_api_bootstrap_node|bool
external_upgrade_tasks:
- when: step|int == 1
block: