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: I0ab7ed83df6afc164a6bd47cf0eb3eda56e2a41c Closes-Bug: 1579718
This commit is contained in:
parent
ba159e362d
commit
79691a6d40
|
@ -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 ironic::db (
|
||||
$database_connection = 'sqlite:////var/lib/ironic/ovs.sqlite',
|
||||
$database_idle_timeout = $::os_service_default,
|
||||
|
@ -41,6 +46,7 @@ class ironic::db (
|
|||
$database_min_pool_size = $::os_service_default,
|
||||
$database_max_pool_size = $::os_service_default,
|
||||
$database_max_overflow = $::os_service_default,
|
||||
$database_db_max_retries = $::os_service_default,
|
||||
) {
|
||||
|
||||
# NOTE(spredzy): In order to keep backward compatibility we rely on the pick function
|
||||
|
@ -64,6 +70,7 @@ class ironic::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,
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ describe 'ironic::db' do
|
|||
it { is_expected.to contain_ironic_config('database/max_overflow').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_ironic_config('database/max_retries').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_ironic_config('database/retry_interval').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_ironic_config('database/db_max_retries').with_value('<SERVICE DEFAULT>') }
|
||||
|
||||
end
|
||||
|
||||
|
@ -24,7 +25,9 @@ describe 'ironic::db' do
|
|||
:database_max_pool_size => '21',
|
||||
:database_max_retries => '11',
|
||||
:database_max_overflow => '21',
|
||||
:database_retry_interval => '11', }
|
||||
:database_retry_interval => '11',
|
||||
:database_db_max_retries => '-1',
|
||||
}
|
||||
end
|
||||
|
||||
it { is_expected.to contain_ironic_config('database/connection').with_value('mysql+pymysql://ironic:ironic@localhost/ironic').with_secret(true) }
|
||||
|
@ -34,6 +37,7 @@ describe 'ironic::db' do
|
|||
it { is_expected.to contain_ironic_config('database/max_pool_size').with_value('21') }
|
||||
it { is_expected.to contain_ironic_config('database/max_overflow').with_value('21') }
|
||||
it { is_expected.to contain_ironic_config('database/retry_interval').with_value('11') }
|
||||
it { is_expected.to contain_ironic_config('database/db_max_retries').with_value('-1') }
|
||||
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue