Simplify anchor definitions

We have been using redundant definitions so that users can override
order but this is no longer required in recent upgrades.

Change-Id: Id60a655fcdbd05abd34165a5430ab1683bf7cfd5
This commit is contained in:
Takashi Kajinami 2023-10-13 00:22:22 +09:00
parent c39ac513f4
commit 8547f78556
7 changed files with 17 additions and 51 deletions

View File

@ -32,7 +32,6 @@ class nova::db::online_data_migrations(
subscribe => [
Anchor['nova::install::end'],
Anchor['nova::config::end'],
Anchor['nova::dbsync_api::end'],
Anchor['nova::db_online_data_migrations::begin']
],
notify => Anchor['nova::db_online_data_migrations::end'],

View File

@ -32,7 +32,6 @@ class nova::db::sync(
subscribe => [
Anchor['nova::install::end'],
Anchor['nova::config::end'],
Anchor['nova::db::end'],
Anchor['nova::dbsync::begin']
],
notify => Anchor['nova::dbsync::end'],

View File

@ -41,7 +41,6 @@ class nova::db::sync_api(
subscribe => [
Anchor['nova::install::end'],
Anchor['nova::config::end'],
Anchor['nova::db::end'],
Anchor['nova::dbsync_api::begin']
],
notify => Anchor['nova::dbsync_api::end'],

View File

@ -18,6 +18,8 @@ class nova::deps {
~> anchor { 'nova::config::end': }
-> anchor { 'nova::db::begin': }
-> anchor { 'nova::db::end': }
~> anchor { 'nova::dbsync::begin': }
-> anchor { 'nova::dbsync::end': }
~> anchor { 'nova::service::begin': }
~> Service<| tag == 'nova-service' |>
~> anchor { 'nova::service::end': }
@ -95,46 +97,22 @@ class nova::deps {
Anchor['nova::install::end'] ~> Anchor['nova::service::begin']
Anchor['nova::config::end'] ~> Anchor['nova::service::begin']
#############################################################################
# NOTE(aschultz): these are defined here because this syntax allows us
# to override the subscribe/notify order using the spaceship operator.
# The ->/~> does not seem to be able to be updated after the fact. Since
# we have to flip cell v2 ordering for the N->O upgrade process, we need
# to not use the chaining arrows. ugh.
#############################################################################
# Wedge this in after the db creation and before the services
anchor { 'nova::dbsync_api::begin':
subscribe => Anchor['nova::db::end']
}
-> anchor { 'nova::dbsync_api::end':
notify => Anchor['nova::service::begin'],
}
# Nova requres separate sync operation for API db, and it should be executed
# before non-API db sync.
Anchor['nova::db::end']
~> anchor { 'nova::dbsync_api::begin': }
-> anchor { 'nova::dbsync_api::end': }
~> Anchor['nova::dbsync::begin']
# Wedge this after db creation and api sync but before the services
anchor { 'nova::dbsync::begin':
subscribe => [
Anchor['nova::db::end'],
Anchor['nova::dbsync_api::end']
]
}
-> anchor { 'nova::dbsync::end':
notify => Anchor['nova::service::begin']
}
Anchor['nova::dbsync_api::end'] ~> Anchor['nova::service::begin']
# Between api sync and db sync by default but can be overridden
# using the spaceship operator to move it around when needed
anchor { 'nova::cell_v2::begin':
subscribe => Anchor['nova::dbsync_api::end']
}
~> anchor { 'nova::cell_v2::end':
notify => Anchor['nova::dbsync::begin']
}
Anchor['nova::dbsync_api::end']
~> anchor { 'nova::cell_v2::begin': }
~> anchor { 'nova::cell_v2::end': }
~> Anchor['nova::dbsync::begin']
# Wedge online data migrations after db/api_sync and before service
anchor { 'nova::db_online_data_migrations::begin':
subscribe => Anchor['nova::dbsync_api::end']
}
-> anchor { 'nova::db_online_data_migrations::end':
notify => Anchor['nova::service::begin']
}
Anchor['nova::dbsync_api::end']
~> anchor { 'nova::db_online_data_migrations::begin': }
-> anchor { 'nova::db_online_data_migrations::end': }
~> Anchor['nova::service::begin']
}

View File

@ -15,7 +15,6 @@ describe 'nova::db::online_data_migrations' do
:logoutput => 'on_failure',
:subscribe => ['Anchor[nova::install::end]',
'Anchor[nova::config::end]',
'Anchor[nova::dbsync_api::end]',
'Anchor[nova::db_online_data_migrations::begin]'],
:notify => 'Anchor[nova::db_online_data_migrations::end]',
)
@ -39,7 +38,6 @@ describe 'nova::db::online_data_migrations' do
:logoutput => 'on_failure',
:subscribe => ['Anchor[nova::install::end]',
'Anchor[nova::config::end]',
'Anchor[nova::dbsync_api::end]',
'Anchor[nova::db_online_data_migrations::begin]'],
:notify => 'Anchor[nova::db_online_data_migrations::end]',
)
@ -64,7 +62,6 @@ describe 'nova::db::online_data_migrations' do
:logoutput => 'on_failure',
:subscribe => ['Anchor[nova::install::end]',
'Anchor[nova::config::end]',
'Anchor[nova::dbsync_api::end]',
'Anchor[nova::db_online_data_migrations::begin]'],
:notify => 'Anchor[nova::db_online_data_migrations::end]',
)

View File

@ -13,7 +13,6 @@ describe 'nova::db::sync_api' do
:logoutput => 'on_failure',
:subscribe => ['Anchor[nova::install::end]',
'Anchor[nova::config::end]',
'Anchor[nova::db::end]',
'Anchor[nova::dbsync_api::begin]'],
:notify => 'Anchor[nova::dbsync_api::end]',
:tag => 'openstack-db',
@ -39,7 +38,6 @@ describe 'nova::db::sync_api' do
:logoutput => 'on_failure',
:subscribe => ['Anchor[nova::install::end]',
'Anchor[nova::config::end]',
'Anchor[nova::db::end]',
'Anchor[nova::dbsync_api::begin]'],
:notify => 'Anchor[nova::dbsync_api::end]',
:tag => 'openstack-db',
@ -64,7 +62,6 @@ describe 'nova::db::sync_api' do
:logoutput => 'on_failure',
:subscribe => ['Anchor[nova::install::end]',
'Anchor[nova::config::end]',
'Anchor[nova::db::end]',
'Anchor[nova::dbsync_api::begin]'],
:notify => 'Anchor[nova::dbsync_api::end]',
:tag => 'openstack-db',

View File

@ -17,7 +17,6 @@ describe 'nova::db::sync' do
:logoutput => 'on_failure',
:subscribe => ['Anchor[nova::install::end]',
'Anchor[nova::config::end]',
'Anchor[nova::db::end]',
'Anchor[nova::dbsync::begin]'],
:notify => 'Anchor[nova::dbsync::end]',
:tag => 'openstack-db',
@ -42,7 +41,6 @@ describe 'nova::db::sync' do
:logoutput => 'on_failure',
:subscribe => ['Anchor[nova::install::end]',
'Anchor[nova::config::end]',
'Anchor[nova::db::end]',
'Anchor[nova::dbsync::begin]'],
:notify => 'Anchor[nova::dbsync::end]',
:tag => 'openstack-db',
@ -68,7 +66,6 @@ describe 'nova::db::sync' do
:logoutput => 'on_failure',
:subscribe => ['Anchor[nova::install::end]',
'Anchor[nova::config::end]',
'Anchor[nova::db::end]',
'Anchor[nova::dbsync::begin]'],
:notify => 'Anchor[nova::dbsync::end]',
:tag => 'openstack-db',