Browse Source

Deprecate min_pool_size option

min_pool_size option is not used,see:

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

Change-Id: I1faec7b1a7bcfa00d4b546ba455ee07edf429426
Closes-Bug: #1868511
tags/16.2.0
ZhongShengping 3 months ago
parent
commit
1338b26b02
3 changed files with 13 additions and 9 deletions
  1. +9
    -6
      manifests/db.pp
  2. +4
    -0
      releasenotes/notes/deprecate_database_min_pool_size-option-854fd8fed2229651.yaml
  3. +0
    -3
      spec/defines/oslo_db_spec.rb

+ 9
- 6
manifests/db.pp View File

@@ -46,10 +46,6 @@
# (Optional) Timeout before idle SQL connections are reaped.
# Defaults to $::os_service_default
#
# [*min_pool_size*]
# (Optional) Minimum number of SQL connections to keep open in a pool.
# Defaults to $::os_service_default
#
# [*max_pool_size*]
# (Optional) Maximum number of SQL connections to keep open in a pool.
# Defaults to $::os_service_default
@@ -112,6 +108,10 @@
# (Optional) Timeout before idle SQL connections are reaped.
# Defaults to undef
#
# [*min_pool_size*]
# (Optional) Minimum number of SQL connections to keep open in a pool.
# Defaults to undef
#
define oslo::db(
$config_group = 'database',
$sqlite_synchronous = $::os_service_default,
@@ -122,7 +122,6 @@ define oslo::db(
$slave_connection = $::os_service_default,
$mysql_sql_mode = $::os_service_default,
$connection_recycle_time = $::os_service_default,
$min_pool_size = $::os_service_default,
$max_pool_size = $::os_service_default,
$max_retries = $::os_service_default,
$retry_interval = $::os_service_default,
@@ -138,6 +137,7 @@ define oslo::db(
$use_tpool = $::os_service_default,
# DEPRCATED PARAMETERS
$idle_timeout = $::os_service_default,
$min_pool_size = undef,
) {

include oslo::params
@@ -187,6 +187,10 @@ define oslo::db(
warning('The idle_timeout parameter is deprecated. Please use connection_recycle_time instead.')
}

if $min_pool_size {
warning('The min_pool_size parameter is deprecated, and will be removed in a future release.')
}

$database_options = {
"${config_group}/sqlite_synchronous" => { value => $sqlite_synchronous },
"${config_group}/backend" => { value => $backend },
@@ -194,7 +198,6 @@ define oslo::db(
"${config_group}/slave_connection" => { value => $slave_connection, secret => true },
"${config_group}/mysql_sql_mode" => { value => $mysql_sql_mode },
"${config_group}/connection_recycle_time" => { value => $connection_recycle_time },
"${config_group}/min_pool_size" => { value => $min_pool_size },
"${config_group}/max_pool_size" => { value => $max_pool_size },
"${config_group}/max_retries" => { value => $max_retries },
"${config_group}/retry_interval" => { value => $retry_interval },


+ 4
- 0
releasenotes/notes/deprecate_database_min_pool_size-option-854fd8fed2229651.yaml View File

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

+ 0
- 3
spec/defines/oslo_db_spec.rb View File

@@ -14,7 +14,6 @@ describe 'oslo::db' do
is_expected.to contain_keystone_config('database/slave_connection').with_value('<SERVICE DEFAULT>')
is_expected.to contain_keystone_config('database/mysql_sql_mode').with_value('<SERVICE DEFAULT>')
is_expected.to contain_keystone_config('database/connection_recycle_time').with_value('<SERVICE DEFAULT>')
is_expected.to contain_keystone_config('database/min_pool_size').with_value('<SERVICE DEFAULT>')
is_expected.to contain_keystone_config('database/max_pool_size').with_value('<SERVICE DEFAULT>')
is_expected.to contain_keystone_config('database/max_retries').with_value('<SERVICE DEFAULT>')
is_expected.to contain_keystone_config('database/retry_interval').with_value('<SERVICE DEFAULT>')
@@ -39,7 +38,6 @@ describe 'oslo::db' do
:connection => 'mysql+pymysql://db:db@localhost/db',
:mysql_sql_mode => 'TRADITIONAL',
:connection_recycle_time => '3601',
:min_pool_size => '2',
:max_pool_size => '100',
:max_retries => '10',
:retry_interval => '10',
@@ -61,7 +59,6 @@ describe 'oslo::db' do
is_expected.to contain_keystone_config('custom_group/connection').with_value('mysql+pymysql://db:db@localhost/db').with_secret(true)
is_expected.to contain_keystone_config('custom_group/mysql_sql_mode').with_value('TRADITIONAL')
is_expected.to contain_keystone_config('custom_group/connection_recycle_time').with_value('3601')
is_expected.to contain_keystone_config('custom_group/min_pool_size').with_value('2')
is_expected.to contain_keystone_config('custom_group/max_pool_size').with_value('100')
is_expected.to contain_keystone_config('custom_group/max_retries').with_value('10')
is_expected.to contain_keystone_config('custom_group/retry_interval').with_value('10')


Loading…
Cancel
Save