Browse Source

Deprecate min_pool_size option

min_pool_size option is not used,see:

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

Change-Id: I643456548591f8dc6355fe90734ab35ba2de0706
Closes-Bug: #1868511
tags/16.2.0
ZhongShengping 4 months ago
parent
commit
7e24be3e85
6 changed files with 36 additions and 24 deletions
  1. +12
    -7
      manifests/db.pp
  2. +8
    -5
      manifests/init.pp
  3. +12
    -6
      manifests/inspector/db.pp
  4. +4
    -0
      releasenotes/notes/deprecate_database_min_pool_size-option-ba39d773426a45fd.yaml
  5. +0
    -3
      spec/classes/ironic_db_spec.rb
  6. +0
    -3
      spec/classes/ironic_inspector_db_spec.rb

+ 12
- 7
manifests/db.pp View File

@@ -21,10 +21,6 @@
# Interval between retries of opening a sql connection.
# (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
@@ -42,20 +38,31 @@
# (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 ironic::db (
$database_connection = 'sqlite:////var/lib/ironic/ovs.sqlite',
$database_connection_recycle_time = $::os_service_default,
$database_max_retries = $::os_service_default,
$database_retry_interval = $::os_service_default,
$database_min_pool_size = $::os_service_default,
$database_max_pool_size = $::os_service_default,
$database_max_overflow = $::os_service_default,
$database_db_max_retries = $::os_service_default,
$database_pool_timeout = $::os_service_default,
# DEPRECATED PARAMETERS
$database_min_pool_size = undef,
) {

include ironic::deps

if $::ironic::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
# to use ironic::<myparam> if ironic::db::<myparam> isn't specified.
$database_connection_real = pick($::ironic::database_connection, $database_connection)
@@ -63,7 +70,6 @@ class ironic::db (
$database_connection_recycle_time)
$database_max_retries_real = pick($::ironic::database_max_retries, $database_max_retries)
$database_retry_interval_real = pick($::ironic::database_retry_interval, $database_retry_interval)
$database_min_pool_size_real = pick($::ironic::database_min_pool_size, $database_min_pool_size)
$database_max_pool_size_real = pick($::ironic::database_max_pool_size, $database_max_pool_size)
$database_max_overflow_real = pick($::ironic::database_max_overflow, $database_max_overflow)

@@ -73,7 +79,6 @@ class ironic::db (
oslo::db { 'ironic_config':
connection => $database_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

@@ -224,10 +224,6 @@
# (optional) Database reconnection interval in seconds.
# 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
@@ -272,6 +268,12 @@
# (optional) Topics for the versioned notifications issued by Ironic
# 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 ironic (
$enabled = true,
$package_ensure = 'present',
@@ -317,7 +319,6 @@ class ironic (
$database_idle_timeout = undef,
$database_reconnect_interval = undef,
$database_retry_interval = undef,
$database_min_pool_size = undef,
$database_max_pool_size = undef,
$database_max_overflow = undef,
$sync_db = true,
@@ -328,6 +329,8 @@ class ironic (
$notification_topics = $::os_service_default,
$notification_level = $::os_service_default,
$versioned_notifications_topics = $::os_service_default,
# DEPRECATED PARAMETERS
$database_min_pool_size = undef,
) {

include ironic::deps


+ 12
- 6
manifests/inspector/db.pp View File

@@ -26,10 +26,6 @@
# Interval between retries of opening a sql connection.
# (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
@@ -42,20 +38,31 @@
# (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 ironic::inspector::db (
$database_connection = 'sqlite:////var/lib/ironic-inspector/inspector.sqlite',
$database_connection_recycle_time = $::os_service_default,
$database_max_retries = $::os_service_default,
$database_db_max_retries = $::os_service_default,
$database_retry_interval = $::os_service_default,
$database_min_pool_size = $::os_service_default,
$database_max_pool_size = $::os_service_default,
$database_max_overflow = $::os_service_default,
$database_pool_timeout = $::os_service_default,
# DEPRECATED PARAMETERS
$database_min_pool_size = undef,
) {

include ironic::params

if $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($::ironic::inspector::db_connection, $database_connection)

validate_legacy(Oslo::Dbconn, 'validate_re', $database_connection_real,
@@ -64,7 +71,6 @@ class ironic::inspector::db (
oslo::db { 'ironic_inspector_config':
connection => $database_connection_real,
connection_recycle_time => $database_connection_recycle_time,
min_pool_size => $database_min_pool_size,
max_pool_size => $database_max_pool_size,
max_retries => $database_max_retries,
db_max_retries => $database_max_retries,


+ 4
- 0
releasenotes/notes/deprecate_database_min_pool_size-option-ba39d773426a45fd.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/ironic_db_spec.rb View File

@@ -9,7 +9,6 @@ describe 'ironic::db' do
:db_max_retries => '<SERVICE DEFAULT>',
:connection => 'sqlite:////var/lib/ironic/ovs.sqlite',
:connection_recycle_time => '<SERVICE DEFAULT>',
:min_pool_size => '<SERVICE DEFAULT>',
:max_pool_size => '<SERVICE DEFAULT>',
:max_retries => '<SERVICE DEFAULT>',
:pool_timeout => '<SERVICE DEFAULT>',
@@ -23,7 +22,6 @@ describe 'ironic::db' do
{
:database_connection => 'mysql+pymysql://ironic:ironic@localhost/ironic',
:database_connection_recycle_time => '3601',
:database_min_pool_size => '2',
:database_max_pool_size => '21',
:database_max_retries => '11',
:database_pool_timeout => '21',
@@ -39,7 +37,6 @@ describe 'ironic::db' do
:db_max_retries => '-1',
:connection => 'mysql+pymysql://ironic:ironic@localhost/ironic',
:connection_recycle_time => '3601',
:min_pool_size => '2',
:max_pool_size => '21',
:max_retries => '11',
:retry_interval => '11',


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

@@ -8,7 +8,6 @@ describe 'ironic::inspector::db' do
it { should contain_oslo__db('ironic_inspector_config').with(
:connection => 'sqlite:////var/lib/ironic-inspector/inspector.sqlite',
:connection_recycle_time => '<SERVICE DEFAULT>',
:min_pool_size => '<SERVICE DEFAULT>',
:max_pool_size => '<SERVICE DEFAULT>',
:max_retries => '<SERVICE DEFAULT>',
:db_max_retries => '<SERVICE DEFAULT>',
@@ -23,7 +22,6 @@ describe 'ironic::inspector::db' do
let :params do
{ :database_connection => 'mysql+pymysql://ironic:ironic@localhost/ironic',
:database_connection_recycle_time => '3601',
:database_min_pool_size => '2',
:database_max_pool_size => '21',
:database_max_retries => '11',
:database_db_max_retries => '11',
@@ -35,7 +33,6 @@ describe 'ironic::inspector::db' do
it { should contain_oslo__db('ironic_inspector_config').with(
:connection => 'mysql+pymysql://ironic:ironic@localhost/ironic',
:connection_recycle_time => '3601',
:min_pool_size => '2',
:max_pool_size => '21',
:max_retries => '11',
:db_max_retries => '11',


Loading…
Cancel
Save