Deprecate min_pool_size option

min_pool_size option is not used,see:

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

Change-Id: Ibd40fed67872c502f54f12c07ebe20fa47089aa5
Closes-Bug: #1868511
This commit is contained in:
ZhongShengping 2020-03-25 14:53:41 +08:00
parent 5a6838f7cd
commit 1084af6e86
4 changed files with 24 additions and 15 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.
@ -46,10 +42,15 @@
# (Optional) Run db sync on nodes after connection setting has been set. # (Optional) Run db sync on nodes after connection setting has been set.
# Defaults to true # Defaults to true
# #
# DEPRECATED PARAMETERS
#
# [*database_min_pool_size*]
# Minimum number of SQL connections to keep open in a pool.
# (Optional) Defaults to undef
#
class heat::db ( class heat::db (
$database_connection = 'sqlite:////var/lib/heat/heat.sqlite', $database_connection = 'sqlite:////var/lib/heat/heat.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,
@ -57,15 +58,20 @@ class heat::db (
$database_pool_timeout = $::os_service_default, $database_pool_timeout = $::os_service_default,
$database_db_max_retries = $::os_service_default, $database_db_max_retries = $::os_service_default,
$sync_db = true, $sync_db = true,
# DEPRECATED PARAMETERS
$database_min_pool_size = undef,
) { ) {
include heat::deps include heat::deps
if $::heat::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 heat::<myparam> if heat::db::<myparam> isn't specified. # to use heat::<myparam> if heat::db::<myparam> isn't specified.
$database_connection_real = pick($::heat::database_connection, $database_connection) $database_connection_real = pick($::heat::database_connection, $database_connection)
$database_connection_recycle_time_real = pick($::heat::database_idle_timeout, $database_connection_recycle_time) $database_connection_recycle_time_real = pick($::heat::database_idle_timeout, $database_connection_recycle_time)
$database_min_pool_size_real = pick($::heat::database_min_pool_size, $database_min_pool_size)
$database_max_pool_size_real = pick($::heat::database_max_pool_size, $database_max_pool_size) $database_max_pool_size_real = pick($::heat::database_max_pool_size, $database_max_pool_size)
$database_max_retries_real = pick($::heat::database_max_retries, $database_max_retries) $database_max_retries_real = pick($::heat::database_max_retries, $database_max_retries)
$database_retry_interval_real = pick($::heat::database_retry_interval, $database_retry_interval) $database_retry_interval_real = pick($::heat::database_retry_interval, $database_retry_interval)
@ -78,7 +84,6 @@ class heat::db (
oslo::db { 'heat_config': oslo::db { 'heat_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

@ -209,10 +209,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.
@ -281,6 +277,12 @@
# take for evaluation. # take for evaluation.
# 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 heat( class heat(
$package_ensure = 'present', $package_ensure = 'present',
$keystone_ec2_uri = $::os_service_default, $keystone_ec2_uri = $::os_service_default,
@ -321,7 +323,6 @@ class heat(
$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,
$flavor = $::os_service_default, $flavor = $::os_service_default,
@ -342,6 +343,8 @@ class heat(
$auth_strategy = 'keystone', $auth_strategy = 'keystone',
$yaql_memory_quota = $::os_service_default, $yaql_memory_quota = $::os_service_default,
$yaql_limit_iterators = $::os_service_default, $yaql_limit_iterators = $::os_service_default,
# DEPRECATED PARAMETERS
$database_min_pool_size = undef,
) { ) {
include heat::db include heat::db

View File

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

View File

@ -9,7 +9,6 @@ describe 'heat::db' do
:db_max_retries => '<SERVICE DEFAULT>', :db_max_retries => '<SERVICE DEFAULT>',
:connection => 'sqlite:////var/lib/heat/heat.sqlite', :connection => 'sqlite:////var/lib/heat/heat.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>',
@ -25,7 +24,6 @@ describe 'heat::db' do
{ {
:database_connection => 'mysql+pymysql://heat:heat@localhost/heat', :database_connection => 'mysql+pymysql://heat:heat@localhost/heat',
:database_connection_recycle_time => '3601', :database_connection_recycle_time => '3601',
:database_min_pool_size => '2',
:database_max_pool_size => '12', :database_max_pool_size => '12',
:database_max_retries => '11', :database_max_retries => '11',
:database_retry_interval => '11', :database_retry_interval => '11',
@ -42,7 +40,6 @@ describe 'heat::db' do
:db_max_retries => '-1', :db_max_retries => '-1',
:connection => 'mysql+pymysql://heat:heat@localhost/heat', :connection => 'mysql+pymysql://heat:heat@localhost/heat',
:connection_recycle_time => '3601', :connection_recycle_time => '3601',
:min_pool_size => '2',
:max_pool_size => '12', :max_pool_size => '12',
:max_retries => '11', :max_retries => '11',
:retry_interval => '11', :retry_interval => '11',