diff --git a/manifests/db.pp b/manifests/db.pp index a6209ad4..3a454233 100644 --- a/manifests/db.pp +++ b/manifests/db.pp @@ -21,10 +21,6 @@ # Interval between retries of opening a sql connection. # (Optional) Defaults to $::os_service_default # -# [*database_min_pool_size*] -# Minimum number of SQL connections to keep open in a pool. -# (Optional) Defaults to $::os_service_default -# # [*database_max_pool_size*] # Maximum number of SQL connections to keep open in a pool. # (Optional) Defaults to $::os_service_default @@ -42,20 +38,31 @@ # (Optional) If set, use this value for pool_timeout with SQLAlchemy. # Defaults to $::os_service_default # +# DEPRECATED PARAMETERS +# +# [*database_min_pool_size*] +# Minimum number of SQL connections to keep open in a pool. +# (Optional) Defaults to undef +# class ironic::db ( $database_connection = 'sqlite:////var/lib/ironic/ovs.sqlite', $database_connection_recycle_time = $::os_service_default, $database_max_retries = $::os_service_default, $database_retry_interval = $::os_service_default, - $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, $database_pool_timeout = $::os_service_default, + # DEPRECATED PARAMETERS + $database_min_pool_size = undef, ) { include ironic::deps + if $::ironic::database_min_pool_size or $database_min_pool_size { + warning('The database_min_pool_size parameter is deprecated, and will be removed in a future release.') + } + # NOTE(spredzy): In order to keep backward compatibility we rely on the pick function # to use ironic:: if ironic::db:: isn't specified. $database_connection_real = pick($::ironic::database_connection, $database_connection) @@ -63,7 +70,6 @@ class ironic::db ( $database_connection_recycle_time) $database_max_retries_real = pick($::ironic::database_max_retries, $database_max_retries) $database_retry_interval_real = pick($::ironic::database_retry_interval, $database_retry_interval) - $database_min_pool_size_real = pick($::ironic::database_min_pool_size, $database_min_pool_size) $database_max_pool_size_real = pick($::ironic::database_max_pool_size, $database_max_pool_size) $database_max_overflow_real = pick($::ironic::database_max_overflow, $database_max_overflow) @@ -73,7 +79,6 @@ class ironic::db ( oslo::db { 'ironic_config': connection => $database_connection_real, connection_recycle_time => $database_connection_recycle_time_real, - min_pool_size => $database_min_pool_size_real, max_pool_size => $database_max_pool_size_real, max_retries => $database_max_retries_real, retry_interval => $database_retry_interval_real, diff --git a/manifests/init.pp b/manifests/init.pp index 314c5bec..0c1668ea 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -224,10 +224,6 @@ # (optional) Database reconnection interval in seconds. # Defaults to: undef # -# [*database_min_pool_size*] -# (optional) Minimum number of SQL connections to keep open in a pool. -# Defaults to: undef -# # [*database_max_pool_size*] # (optional) Maximum number of SQL connections to keep open in a pool. # Defaults to: undef @@ -272,6 +268,12 @@ # (optional) Topics for the versioned notifications issued by Ironic # Defaults to $::os_service_default # +# DEPRECATED PARAMETERS +# +# [*database_min_pool_size*] +# (optional) Minimum number of SQL connections to keep open in a pool. +# Defaults to: undef +# class ironic ( $enabled = true, $package_ensure = 'present', @@ -317,7 +319,6 @@ class ironic ( $database_idle_timeout = undef, $database_reconnect_interval = undef, $database_retry_interval = undef, - $database_min_pool_size = undef, $database_max_pool_size = undef, $database_max_overflow = undef, $sync_db = true, @@ -328,6 +329,8 @@ class ironic ( $notification_topics = $::os_service_default, $notification_level = $::os_service_default, $versioned_notifications_topics = $::os_service_default, + # DEPRECATED PARAMETERS + $database_min_pool_size = undef, ) { include ironic::deps diff --git a/manifests/inspector/db.pp b/manifests/inspector/db.pp index 632fd13f..b9215b19 100644 --- a/manifests/inspector/db.pp +++ b/manifests/inspector/db.pp @@ -26,10 +26,6 @@ # Interval between retries of opening a sql connection. # (Optional) Defaults to $::os_service_default # -# [*database_min_pool_size*] -# Minimum number of SQL connections to keep open in a pool. -# (Optional) Defaults to $::os_service_default -# # [*database_max_pool_size*] # Maximum number of SQL connections to keep open in a pool. # (Optional) Defaults to $::os_service_default @@ -42,20 +38,31 @@ # (Optional) If set, use this value for pool_timeout with SQLAlchemy. # Defaults to $::os_service_default # +# DEPRECATED PARAMETERS +# +# [*database_min_pool_size*] +# Minimum number of SQL connections to keep open in a pool. +# (Optional) Defaults to undef +# class ironic::inspector::db ( $database_connection = 'sqlite:////var/lib/ironic-inspector/inspector.sqlite', $database_connection_recycle_time = $::os_service_default, $database_max_retries = $::os_service_default, $database_db_max_retries = $::os_service_default, $database_retry_interval = $::os_service_default, - $database_min_pool_size = $::os_service_default, $database_max_pool_size = $::os_service_default, $database_max_overflow = $::os_service_default, $database_pool_timeout = $::os_service_default, + # DEPRECATED PARAMETERS + $database_min_pool_size = undef, ) { include ironic::params + if $database_min_pool_size { + warning('The database_min_pool_size parameter is deprecated, and will be removed in a future release.') + } + $database_connection_real = pick($::ironic::inspector::db_connection, $database_connection) validate_legacy(Oslo::Dbconn, 'validate_re', $database_connection_real, @@ -64,7 +71,6 @@ class ironic::inspector::db ( oslo::db { 'ironic_inspector_config': connection => $database_connection_real, connection_recycle_time => $database_connection_recycle_time, - min_pool_size => $database_min_pool_size, max_pool_size => $database_max_pool_size, max_retries => $database_max_retries, db_max_retries => $database_max_retries, diff --git a/releasenotes/notes/deprecate_database_min_pool_size-option-ba39d773426a45fd.yaml b/releasenotes/notes/deprecate_database_min_pool_size-option-ba39d773426a45fd.yaml new file mode 100644 index 00000000..03e58c2b --- /dev/null +++ b/releasenotes/notes/deprecate_database_min_pool_size-option-ba39d773426a45fd.yaml @@ -0,0 +1,4 @@ +--- +deprecations: + - database_min_pool_size option is now deprecated for removal, the + parameter has no effect. diff --git a/spec/classes/ironic_db_spec.rb b/spec/classes/ironic_db_spec.rb index eaad4b69..10df1171 100644 --- a/spec/classes/ironic_db_spec.rb +++ b/spec/classes/ironic_db_spec.rb @@ -9,7 +9,6 @@ describe 'ironic::db' do :db_max_retries => '', :connection => 'sqlite:////var/lib/ironic/ovs.sqlite', :connection_recycle_time => '', - :min_pool_size => '', :max_pool_size => '', :max_retries => '', :pool_timeout => '', @@ -23,7 +22,6 @@ describe 'ironic::db' do { :database_connection => 'mysql+pymysql://ironic:ironic@localhost/ironic', :database_connection_recycle_time => '3601', - :database_min_pool_size => '2', :database_max_pool_size => '21', :database_max_retries => '11', :database_pool_timeout => '21', @@ -39,7 +37,6 @@ describe 'ironic::db' do :db_max_retries => '-1', :connection => 'mysql+pymysql://ironic:ironic@localhost/ironic', :connection_recycle_time => '3601', - :min_pool_size => '2', :max_pool_size => '21', :max_retries => '11', :retry_interval => '11', diff --git a/spec/classes/ironic_inspector_db_spec.rb b/spec/classes/ironic_inspector_db_spec.rb index 5072e6b4..4a35ca36 100644 --- a/spec/classes/ironic_inspector_db_spec.rb +++ b/spec/classes/ironic_inspector_db_spec.rb @@ -8,7 +8,6 @@ describe 'ironic::inspector::db' do it { should contain_oslo__db('ironic_inspector_config').with( :connection => 'sqlite:////var/lib/ironic-inspector/inspector.sqlite', :connection_recycle_time => '', - :min_pool_size => '', :max_pool_size => '', :max_retries => '', :db_max_retries => '', @@ -23,7 +22,6 @@ describe 'ironic::inspector::db' do let :params do { :database_connection => 'mysql+pymysql://ironic:ironic@localhost/ironic', :database_connection_recycle_time => '3601', - :database_min_pool_size => '2', :database_max_pool_size => '21', :database_max_retries => '11', :database_db_max_retries => '11', @@ -35,7 +33,6 @@ describe 'ironic::inspector::db' do it { should contain_oslo__db('ironic_inspector_config').with( :connection => 'mysql+pymysql://ironic:ironic@localhost/ironic', :connection_recycle_time => '3601', - :min_pool_size => '2', :max_pool_size => '21', :max_retries => '11', :db_max_retries => '11',