Deprecate min_pool_size option

min_pool_size option is not used,see:

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

Change-Id: I683baa116b82a5e1b3cc2242c351d1105f676e32
Closes-Bug: #1868511
This commit is contained in:
ZhongShengping 2020-03-25 14:53:41 +08:00 committed by Tobias Urdin
parent f7bc1dc4f2
commit 3489c25a0f
5 changed files with 21 additions and 16 deletions

View File

@ -12,10 +12,6 @@
# Timeout when db connections should be reaped. # Timeout when db connections should be reaped.
# (Optional) Defaults to $::os_service_default. # (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*] # [*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 $::os_service_default. # (Optional) Defaults to $::os_service_default.
@ -48,10 +44,13 @@
# Timeout when db connections should be reaped. # Timeout when db connections should be reaped.
# Defaults to undef. # Defaults to undef.
# #
# [*database_min_pool_size*]
# Minimum number of SQL connections to keep open in a pool.
# (Optional) Defaults to undef.
#
class neutron::db ( class neutron::db (
$database_connection = 'sqlite:////var/lib/neutron/ovs.sqlite', $database_connection = 'sqlite:////var/lib/neutron/ovs.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,
@ -60,6 +59,7 @@ class neutron::db (
$database_db_max_retries = $::os_service_default, $database_db_max_retries = $::os_service_default,
# DEPRECATED PARAMETERS # DEPRECATED PARAMETERS
$database_idle_timeout = undef, $database_idle_timeout = undef,
$database_min_pool_size = undef,
) { ) {
include neutron::deps include neutron::deps
@ -69,12 +69,15 @@ class neutron::db (
database_connection_recycle_time instead.') database_connection_recycle_time instead.')
} }
if $::neutron::server::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 neutron::<myparam> if neutron::db::<myparam> isn't specified. # to use neutron::<myparam> if neutron::db::<myparam> isn't specified.
$database_connection_real = pick($::neutron::server::database_connection, $database_connection) $database_connection_real = pick($::neutron::server::database_connection, $database_connection)
$database_connection_recycle_time_real = pick($::neutron::server::database_idle_timeout, $database_idle_timeout, $database_connection_recycle_time_real = pick($::neutron::server::database_idle_timeout, $database_idle_timeout,
$database_connection_recycle_time) $database_connection_recycle_time)
$database_min_pool_size_real = pick($::neutron::server::database_min_pool_size, $database_min_pool_size)
$database_max_pool_size_real = pick($::neutron::server::database_max_pool_size, $database_max_pool_size) $database_max_pool_size_real = pick($::neutron::server::database_max_pool_size, $database_max_pool_size)
$database_max_retries_real = pick($::neutron::server::database_max_retries, $database_max_retries) $database_max_retries_real = pick($::neutron::server::database_max_retries, $database_max_retries)
$database_retry_interval_real = pick($::neutron::server::database_retry_interval, $database_retry_interval) $database_retry_interval_real = pick($::neutron::server::database_retry_interval, $database_retry_interval)
@ -88,7 +91,6 @@ database_connection_recycle_time instead.')
oslo::db { 'neutron_config': oslo::db { 'neutron_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_retries => $database_max_retries_real, max_retries => $database_max_retries_real,
retry_interval => $database_retry_interval_real, retry_interval => $database_retry_interval_real,
max_pool_size => $database_max_pool_size_real, max_pool_size => $database_max_pool_size_real,

View File

@ -75,10 +75,6 @@
# (Optional) Interval between retries of opening a database connection. # (Optional) Interval between retries of opening a database connection.
# (Defaults to 10) # (Defaults to 10)
# #
# [*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.
@ -259,6 +255,12 @@
# mechanism driver for Neutron. # mechanism driver for Neutron.
# Defaults to $::os_service_default # 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 neutron::server ( class neutron::server (
$package_ensure = 'present', $package_ensure = 'present',
$enabled = true, $enabled = true,
@ -274,7 +276,6 @@ class neutron::server (
$database_max_retries = undef, $database_max_retries = undef,
$database_idle_timeout = undef, $database_idle_timeout = 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,
$sync_db = false, $sync_db = false,
@ -305,6 +306,8 @@ class neutron::server (
$max_request_body_size = $::os_service_default, $max_request_body_size = $::os_service_default,
$ovs_integration_bridge = $::os_service_default, $ovs_integration_bridge = $::os_service_default,
$igmp_snooping_enable = $::os_service_default, $igmp_snooping_enable = $::os_service_default,
# DEPRECATED PARAMETERS
$database_min_pool_size = undef,
) inherits ::neutron::params { ) inherits ::neutron::params {
include neutron::deps include neutron::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

@ -7,7 +7,6 @@ describe 'neutron::db' do
:db_max_retries => '<SERVICE DEFAULT>', :db_max_retries => '<SERVICE DEFAULT>',
:connection => 'sqlite:////var/lib/neutron/ovs.sqlite', :connection => 'sqlite:////var/lib/neutron/ovs.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>',
@ -21,7 +20,6 @@ describe 'neutron::db' do
{ {
:database_connection => 'mysql+pymysql://neutron:neutron@localhost/neutron', :database_connection => 'mysql+pymysql://neutron:neutron@localhost/neutron',
:database_connection_recycle_time => '3601', :database_connection_recycle_time => '3601',
:database_min_pool_size => '2',
:database_max_pool_size => '11', :database_max_pool_size => '11',
:database_max_retries => '11', :database_max_retries => '11',
:database_retry_interval => '11', :database_retry_interval => '11',
@ -35,7 +33,6 @@ describe 'neutron::db' do
:db_max_retries => '-1', :db_max_retries => '-1',
:connection => 'mysql+pymysql://neutron:neutron@localhost/neutron', :connection => 'mysql+pymysql://neutron:neutron@localhost/neutron',
:connection_recycle_time => '3601', :connection_recycle_time => '3601',
:min_pool_size => '2',
:max_pool_size => '11', :max_pool_size => '11',
:max_retries => '11', :max_retries => '11',
:retry_interval => '11', :retry_interval => '11',

View File

@ -21,7 +21,6 @@ describe 'neutron::server' do
:database_max_retries => 10, :database_max_retries => 10,
:database_idle_timeout => 3600, :database_idle_timeout => 3600,
:database_retry_interval => 10, :database_retry_interval => 10,
:database_min_pool_size => 1,
:database_max_pool_size => 10, :database_max_pool_size => 10,
:database_max_overflow => 20, :database_max_overflow => 20,
:sync_db => false, :sync_db => false,