Browse Source

Deprecate min_pool_size option

min_pool_size option is not used,see:

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

Change-Id: Iadbaa88680a15687c1e4af8a28db74a0794531ea
Closes-Bug: #1868511
tags/16.2.0
ZhongShengping 4 months ago
parent
commit
ea60281eee
4 changed files with 24 additions and 15 deletions
  1. +12
    -7
      manifests/db.pp
  2. +8
    -5
      manifests/init.pp
  3. +4
    -0
      releasenotes/notes/deprecate_database_min_pool_size-option-a91aad0abfd945f1.yaml
  4. +0
    -3
      spec/classes/aodh_db_spec.rb

+ 12
- 7
manifests/db.pp View File

@@ -21,10 +21,6 @@
# Timeout when db connections should be reaped.
# (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.
@@ -46,24 +42,34 @@
# (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 aodh::db (
$database_db_max_retries = $::os_service_default,
$database_connection = 'sqlite:////var/lib/aodh/aodh.sqlite',
$slave_connection = $::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_retries = $::os_service_default,
$database_retry_interval = $::os_service_default,
$database_max_overflow = $::os_service_default,
$database_pool_timeout = $::os_service_default,
# DEPRECATED PARAMETERS
$database_min_pool_size = undef,
) {

include aodh::deps

if $::aodh::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.')
}

$database_connection_real = pick($::aodh::database_connection, $database_connection)
$slave_connection_real = pick($::aodh::slave_connection, $slave_connection)
$database_min_pool_size_real = pick($::aodh::database_min_pool_size, $database_min_pool_size)
$database_max_pool_size_real = pick($::aodh::database_max_pool_size, $database_max_pool_size)
$database_max_retries_real = pick($::aodh::database_max_retries, $database_max_retries)
$database_retry_interval_real = pick($::aodh::database_retry_interval, $database_retry_interval)
@@ -75,7 +81,6 @@ class aodh::db (
connection => $database_connection_real,
slave_connection => $slave_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,


+ 8
- 5
manifests/init.pp View File

@@ -204,10 +204,6 @@
# (optional) Interval between retries of opening a database connection.
# 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.
@@ -221,6 +217,12 @@
# in the aodh config.
# Defaults to false.
#
# DEPRECATED PARAMETERS
#
# [*database_min_pool_size*]
# (optional) Minimum number of SQL connections to keep open in a pool.
# Defaults to undef.
#
class aodh (
$package_ensure = 'present',
$alarm_history_time_to_live = $::os_service_default,
@@ -263,12 +265,13 @@ class aodh (
$database_connection = undef,
$slave_connection = undef,
$database_idle_timeout = undef,
$database_min_pool_size = undef,
$database_max_pool_size = undef,
$database_max_retries = undef,
$database_retry_interval = undef,
$database_max_overflow = undef,
$purge_config = false,
# DEPRECATED PARAMETERS
$database_min_pool_size = undef,
) inherits aodh::params {

include aodh::deps


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

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

+ 0
- 3
spec/classes/aodh_db_spec.rb View File

@@ -9,7 +9,6 @@ describe 'aodh::db' do
:db_max_retries => '<SERVICE DEFAULT>',
:connection => 'sqlite:////var/lib/aodh/aodh.sqlite',
:connection_recycle_time => '<SERVICE DEFAULT>',
:min_pool_size => '<SERVICE DEFAULT>',
:max_pool_size => '<SERVICE DEFAULT>',
:max_retries => '<SERVICE DEFAULT>',
:retry_interval => '<SERVICE DEFAULT>',
@@ -25,7 +24,6 @@ describe 'aodh::db' do
:database_connection => 'mysql+pymysql://aodh:aodh@localhost/aodh',
:slave_connection => 'mysql+pymysql://aodh:aodh@localhost2/aodh',
:database_connection_recycle_time => '3601',
:database_min_pool_size => '2',
:database_max_pool_size => '11',
:database_max_retries => '11',
:database_retry_interval => '11',
@@ -41,7 +39,6 @@ describe 'aodh::db' do
:connection => 'mysql+pymysql://aodh:aodh@localhost/aodh',
:slave_connection => 'mysql+pymysql://aodh:aodh@localhost2/aodh',
:connection_recycle_time => '3601',
:min_pool_size => '2',
:max_pool_size => '11',
:max_retries => '11',
:retry_interval => '11',


Loading…
Cancel
Save