Deprecate min_pool_size option

min_pool_size option is not used,see:

https://review.opendev.org/#/c/565090/

Change-Id: I40787084340ec84679d03728c25b5806e56fcefd
Closes-Bug: #1868511
This commit is contained in:
ZhongShengping 2020-03-25 14:53:41 +08:00
parent c812c3a322
commit b4fa0d647c
4 changed files with 24 additions and 15 deletions

View File

@ -21,10 +21,6 @@
# Interval between retries of opening a database connection. # Interval between retries of opening a database connection.
# (Optional) Defaults to 10. # (Optional) Defaults to 10.
# #
# [*database_min_pool_size*]
# Minimum number of SQL connections to keep open in a pool.
# (Optional) Defaults to 1.
#
# [*database_max_pool_size*] # [*database_max_pool_size*]
# Maximum number of SQL connections to keep open in a pool. # Maximum number of SQL connections to keep open in a pool.
# (Optional) Defaults to 10. # (Optional) Defaults to 10.
@ -37,24 +33,34 @@
# (Optional) If set, use this value for pool_timeout with SQLAlchemy. # (Optional) If set, use this value for pool_timeout with SQLAlchemy.
# Defaults to $::os_service_default # 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 trove::db ( class trove::db (
$database_connection = 'sqlite:////var/lib/trove/trove.sqlite', $database_connection = 'sqlite:////var/lib/trove/trove.sqlite',
$database_connection_recycle_time = $::os_service_default, $database_connection_recycle_time = $::os_service_default,
$database_min_pool_size = $::os_service_default,
$database_max_pool_size = $::os_service_default, $database_max_pool_size = $::os_service_default,
$database_max_retries = $::os_service_default, $database_max_retries = $::os_service_default,
$database_retry_interval = $::os_service_default, $database_retry_interval = $::os_service_default,
$database_max_overflow = $::os_service_default, $database_max_overflow = $::os_service_default,
$database_pool_timeout = $::os_service_default, $database_pool_timeout = $::os_service_default,
# DEPRECATED PARAMETERS
$database_min_pool_size = undef,
) { ) {
include trove::deps include trove::deps
if $::trove::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 # NOTE(spredzy): In order to keep backward compatibility we rely on the pick function
# to use trove::<myparam> if trove::db::<myparam> isn't specified. # to use trove::<myparam> if trove::db::<myparam> isn't specified.
$database_connection_real = pick($::trove::database_connection, $database_connection) $database_connection_real = pick($::trove::database_connection, $database_connection)
$database_connection_recycle_time_real = pick($::trove::database_idle_timeout, $database_connection_recycle_time) $database_connection_recycle_time_real = pick($::trove::database_idle_timeout, $database_connection_recycle_time)
$database_min_pool_size_real = pick($::trove::database_min_pool_size, $database_min_pool_size)
$database_max_pool_size_real = pick($::trove::database_max_pool_size, $database_max_pool_size) $database_max_pool_size_real = pick($::trove::database_max_pool_size, $database_max_pool_size)
$database_max_retries_real = pick($::trove::database_max_retries, $database_max_retries) $database_max_retries_real = pick($::trove::database_max_retries, $database_max_retries)
$database_retry_interval_real = pick($::trove::database_retry_interval, $database_retry_interval) $database_retry_interval_real = pick($::trove::database_retry_interval, $database_retry_interval)
@ -66,7 +72,6 @@ class trove::db (
oslo::db { 'trove_config': oslo::db { 'trove_config':
connection => $database_connection_real, connection => $database_connection_real,
connection_recycle_time => $database_connection_recycle_time_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_pool_size => $database_max_pool_size_real,
max_retries => $database_max_retries_real, max_retries => $database_max_retries_real,
retry_interval => $database_retry_interval_real, retry_interval => $database_retry_interval_real,

View File

@ -179,10 +179,6 @@
# (optional) Interval between retries of opening a database connection. # (optional) Interval between retries of opening a database connection.
# Defaults to undef. # 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*] # [*database_max_pool_size*]
# (optional) Maximum number of SQL connections to keep open in a pool. # (optional) Maximum number of SQL connections to keep open in a pool.
# Defaults to: undef. # Defaults to: undef.
@ -294,6 +290,12 @@
# (optional) The state of the package. # (optional) The state of the package.
# Defaults to 'present' # Defaults to 'present'
# #
# DEPRECATED PARAMETERS
#
# [*database_min_pool_size*]
# (optional) Minimum number of SQL connections to keep open in a pool.
# Defaults to: undef.
#
class trove( class trove(
$nova_proxy_admin_pass, $nova_proxy_admin_pass,
$default_transport_url = $::os_service_default, $default_transport_url = $::os_service_default,
@ -331,7 +333,6 @@ class trove(
$database_idle_timeout = undef, $database_idle_timeout = undef,
$database_max_retries = undef, $database_max_retries = undef,
$database_retry_interval = undef, $database_retry_interval = undef,
$database_min_pool_size = undef,
$database_max_pool_size = undef, $database_max_pool_size = undef,
$database_max_overflow = undef, $database_max_overflow = undef,
$single_tenant_mode = false, $single_tenant_mode = false,
@ -358,6 +359,8 @@ class trove(
$use_neutron = true, $use_neutron = true,
$default_neutron_networks = $::os_service_default, $default_neutron_networks = $::os_service_default,
$package_ensure = 'present', $package_ensure = 'present',
# DEPRECATED PARAMETERS
$database_min_pool_size = undef,
) { ) {
include trove::deps include trove::deps

View File

@ -0,0 +1,4 @@
---
deprecations:
- database_min_pool_size option is now deprecated for removal, the
parameter has no effect.

View File

@ -8,7 +8,6 @@ describe 'trove::db' do
it { should contain_oslo__db('trove_config').with( it { should contain_oslo__db('trove_config').with(
:connection => 'sqlite:////var/lib/trove/trove.sqlite', :connection => 'sqlite:////var/lib/trove/trove.sqlite',
:connection_recycle_time => '<SERVICE DEFAULT>', :connection_recycle_time => '<SERVICE DEFAULT>',
:min_pool_size => '<SERVICE DEFAULT>',
:max_pool_size => '<SERVICE DEFAULT>', :max_pool_size => '<SERVICE DEFAULT>',
:max_retries => '<SERVICE DEFAULT>', :max_retries => '<SERVICE DEFAULT>',
:retry_interval => '<SERVICE DEFAULT>', :retry_interval => '<SERVICE DEFAULT>',
@ -22,7 +21,6 @@ describe 'trove::db' do
{ {
:database_connection => 'mysql+pymysql://trove:trove@localhost/trove', :database_connection => 'mysql+pymysql://trove:trove@localhost/trove',
:database_connection_recycle_time => '3601', :database_connection_recycle_time => '3601',
:database_min_pool_size => '2',
:database_max_pool_size => '21', :database_max_pool_size => '21',
:database_max_retries => '11', :database_max_retries => '11',
:database_max_overflow => '21', :database_max_overflow => '21',
@ -36,7 +34,6 @@ describe 'trove::db' do
it { should contain_oslo__db('trove_config').with( it { should contain_oslo__db('trove_config').with(
:connection => 'mysql+pymysql://trove:trove@localhost/trove', :connection => 'mysql+pymysql://trove:trove@localhost/trove',
:connection_recycle_time => '3601', :connection_recycle_time => '3601',
:min_pool_size => '2',
:max_pool_size => '21', :max_pool_size => '21',
:max_retries => '11', :max_retries => '11',
:retry_interval => '11', :retry_interval => '11',