Add support for the oslo db_max_retries parameter
The db_max_retries parameter regulates the number of reconnection attempts performed after an error raised rather than at startup. Change-Id: Ia02d5e1a60d42b7dcca3676253a76e8d1a852894 Closes-Bug: 1579718
This commit is contained in:
parent
337cd8fd97
commit
52b1e4436a
|
@ -33,6 +33,11 @@
|
|||
# If set, use this value for max_overflow with sqlalchemy.
|
||||
# (Optional) Defaults to $::os_service_default
|
||||
#
|
||||
# [*database_db_max_retries*]
|
||||
# (Optional) Maximum retries in case of connection error or deadlock error
|
||||
# before error is raised. Set to -1 to specify an infinite retry count.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
class rally::db (
|
||||
$database_connection = 'sqlite:////var/lib/rally/rally.sqlite',
|
||||
$database_idle_timeout = $::os_service_default,
|
||||
|
@ -41,6 +46,7 @@ class rally::db (
|
|||
$database_max_retries = $::os_service_default,
|
||||
$database_retry_interval = $::os_service_default,
|
||||
$database_max_overflow = $::os_service_default,
|
||||
$database_db_max_retries = $::os_service_default,
|
||||
) {
|
||||
|
||||
$database_connection_real = pick($::rally::database_connection, $database_connection)
|
||||
|
@ -62,6 +68,7 @@ class rally::db (
|
|||
max_retries => $database_max_retries_real,
|
||||
retry_interval => $database_retry_interval_real,
|
||||
max_overflow => $database_max_overflow_real,
|
||||
db_max_retries => $database_db_max_retries,
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ describe 'rally::db' do
|
|||
it { is_expected.to contain_rally_config('database/retry_interval').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_rally_config('database/max_pool_size').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_rally_config('database/max_overflow').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_rally_config('database/db_max_retries').with_value('<SERVICE DEFAULT>') }
|
||||
end
|
||||
|
||||
context 'with specific parameters' do
|
||||
|
@ -22,6 +23,7 @@ describe 'rally::db' do
|
|||
:database_retry_interval => '11',
|
||||
:database_max_pool_size => '11',
|
||||
:database_max_overflow => '21',
|
||||
:database_db_max_retries => '-1',
|
||||
}
|
||||
end
|
||||
|
||||
|
@ -32,6 +34,7 @@ describe 'rally::db' do
|
|||
it { is_expected.to contain_rally_config('database/retry_interval').with_value('11') }
|
||||
it { is_expected.to contain_rally_config('database/max_pool_size').with_value('11') }
|
||||
it { is_expected.to contain_rally_config('database/max_overflow').with_value('21') }
|
||||
it { is_expected.to contain_rally_config('database/db_max_retries').with_value('-1') }
|
||||
end
|
||||
|
||||
context 'with postgresql backend' do
|
||||
|
|
Loading…
Reference in New Issue