ZhongShengping da173ebd0b Allow db sync timeouts to be configurable
As Openstack projects continue to have longer database migration
chains, the Puppet default timeout of 300 seconds for an execution
is becoming too short a duration on some hardware, leading to timeouts.
As projects continue to add more migration scripts without pruning
the base, timeouts will continue to become more frequent unless
this time can be expanded.

Change-Id: Ib8c2242c76106ecb41c267fe75f8f824e2934cc1
Closes-Bug: #1904962
2020-11-23 09:27:52 +08:00

53 lines
1.3 KiB
Puppet

#
# Class to execute "mistral-db-manage 'upgrade head' and 'populate'"
#
# ==Parameters
#
# [*db_sync_timeout*]
# (Optional) Timeout for the execution of the db_sync
# Defaults to 300
#
class mistral::db::sync(
$db_sync_timeout = 300,
) {
include mistral::deps
include mistral::params
exec { 'mistral-db-sync':
command => $::mistral::params::db_sync_command,
path => '/usr/bin',
user => 'mistral',
logoutput => on_failure,
refreshonly => true,
try_sleep => 5,
tries => 10,
timeout => $db_sync_timeout,
subscribe => [
Anchor['mistral::install::end'],
Anchor['mistral::config::end'],
Anchor['mistral::dbsync::begin']
],
notify => Anchor['mistral::dbsync::end'],
tag => 'openstack-db',
}
exec { 'mistral-db-populate':
require => Exec['mistral-db-sync'],
command => $::mistral::params::db_populate_command,
path => '/usr/bin',
user => 'mistral',
timeout => $db_sync_timeout,
logoutput => on_failure,
refreshonly => true,
subscribe => [
Anchor['mistral::install::end'],
Anchor['mistral::config::end'],
Anchor['mistral::dbsync::begin']
],
notify => Anchor['mistral::dbsync::end'],
tag => 'openstack-db',
}
}