diff --git a/manifests/db.pp b/manifests/db.pp index 4674e234..a1378955 100644 --- a/manifests/db.pp +++ b/manifests/db.pp @@ -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 +# # [*sync_db*] # (Optional) Run db sync on nodes after connection setting has been set. # Defaults to true @@ -45,6 +50,7 @@ class heat::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, $sync_db = true, ) { @@ -72,6 +78,7 @@ class heat::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, } if $sync_db_real { diff --git a/spec/classes/heat_db_spec.rb b/spec/classes/heat_db_spec.rb index dea3fc5d..8e07fdc9 100644 --- a/spec/classes/heat_db_spec.rb +++ b/spec/classes/heat_db_spec.rb @@ -13,6 +13,7 @@ describe 'heat::db' do it { is_expected.to contain_heat_config('database/max_pool_size').with_value('') } it { is_expected.to contain_heat_config('database/max_retries').with_value('') } it { is_expected.to contain_heat_config('database/retry_interval').with_value('') } + it { is_expected.to contain_heat_config('database/db_max_retries').with_value('') } end @@ -24,6 +25,7 @@ describe 'heat::db' do :database_max_pool_size => '12', :database_max_retries => '11', :database_retry_interval => '11', + :database_db_max_retries => '-1', :sync_db => false } end @@ -34,6 +36,7 @@ describe 'heat::db' do it { is_expected.to contain_heat_config('database/max_pool_size').with_value('12') } it { is_expected.to contain_heat_config('database/max_retries').with_value('11') } it { is_expected.to contain_heat_config('database/retry_interval').with_value('11') } + it { is_expected.to contain_heat_config('database/db_max_retries').with_value('-1') } end