Browse Source

Deprecate min_pool_size option

min_pool_size option is not used,see:

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

Change-Id: Iead3c6521de9d779845c44d9117b396e3348a8ec
Closes-Bug: #1868511
tags/16.2.0
ZhongShengping 4 months ago
parent
commit
66705cb49a
6 changed files with 33 additions and 24 deletions
  1. +12
    -7
      manifests/db.pp
  2. +12
    -6
      manifests/db_cfapi.pp
  3. +5
    -5
      manifests/init.pp
  4. +4
    -0
      releasenotes/notes/deprecate_database_min_pool_size-option-ad06e672b28f06b0.yaml
  5. +0
    -3
      spec/classes/murano_db_cfapi_spec.rb
  6. +0
    -3
      spec/classes/murano_db_spec.rb

+ 12
- 7
manifests/db.pp View File

@@ -21,10 +21,6 @@
# (optional) Interval between retries of opening a database connection.
# Defaults to $::os_service_default.
#
# [*database_min_pool_size*]
# (optional) Minimum number of SQL connections to keep open in a pool.
# Defaults to $::os_service_default.
#
# [*database_max_pool_size*]
# (optional) Maximum number of SQL connections to keep open in a pool.
# Defaults to $::os_service_default.
@@ -42,25 +38,35 @@
# before error is raised. Set to -1 to specify an infinite retry count.
# 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 murano::db (
$database_connection = 'mysql+pymysql://murano:secrete@localhost:3306/murano',
$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,
$database_db_max_retries = $::os_service_default,
# DEPRECATED PARAMETERS
$database_min_pool_size = undef,
) {

include murano::deps

if $::murano::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(aderyugin): In order to keep backward compatibility we rely on the pick function
# to use murano::<myparam> if murano::db::<myparam> isn't specified.
$database_connection_real = pick($::murano::database_connection, $database_connection)
$database_connection_recycle_time_real = pick($::murano::database_idle_timeout, $database_connection_recycle_time)
$database_min_pool_size_real = pick($::murano::database_min_pool_size, $database_min_pool_size)
$database_max_pool_size_real = pick($::murano::database_max_pool_size, $database_max_pool_size)
$database_max_retries_real = pick($::murano::database_max_retries, $database_max_retries)
$database_retry_interval_real = pick($::murano::database_retry_interval, $database_retry_interval)
@@ -72,7 +78,6 @@ class murano::db (
oslo::db { 'murano_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,


+ 12
- 6
manifests/db_cfapi.pp View File

@@ -21,10 +21,6 @@
# (optional) Interval between retries of opening a database connection.
# Defaults to $::os_service_default.
#
# [*database_min_pool_size*]
# (optional) Minimum number of SQL connections to keep open in a pool.
# Defaults to $::os_service_default.
#
# [*database_max_pool_size*]
# (optional) Maximum number of SQL connections to keep open in a pool.
# Defaults to $::os_service_default.
@@ -38,19 +34,30 @@
# before error is raised. Set to -1 to specify an infinite retry count.
# 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 murano::db_cfapi (
$database_connection = $::os_service_default,
$database_idle_timeout = $::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_db_max_retries = $::os_service_default,
# DEPRECATED PARAMETERS
$database_min_pool_size = undef,
) {

include murano::deps

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

if !is_service_default($database_connection) {

validate_legacy(Oslo::Dbconn, 'validate_re', $database_connection,
@@ -59,7 +66,6 @@ class murano::db_cfapi (
oslo::db { 'murano_cfapi_config':
connection => $database_connection,
idle_timeout => $database_idle_timeout,
min_pool_size => $database_min_pool_size,
max_pool_size => $database_max_pool_size,
max_retries => $database_max_retries,
retry_interval => $database_retry_interval,


+ 5
- 5
manifests/init.pp View File

@@ -190,10 +190,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.
@@ -247,6 +243,10 @@
# (Optional) Admin identity endpoint
# Defaults to 'http://127.0.0.1:5000/'
#
# [*database_min_pool_size*]
# (optional) Minimum number of SQL connections to keep open in a pool.
# Defaults to undef.
#
class murano(
$admin_password,
$package_ensure = 'present',
@@ -288,7 +288,6 @@ class murano(
$packages_service = $::os_service_default,
$database_connection = undef,
$database_idle_timeout = undef,
$database_min_pool_size = undef,
$database_max_pool_size = undef,
$database_max_retries = undef,
$database_retry_interval = undef,
@@ -304,6 +303,7 @@ class murano(
$amqp_durable_queues = $::os_service_default,
# Deprecated
$identity_uri = 'http://127.0.0.1:5000/',
$database_min_pool_size = undef,
) inherits murano::params {

include murano::deps


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

@@ -7,7 +7,6 @@ describe 'murano::db_cfapi' do
context 'with default parameters' do
it { is_expected.to_not contain_murano_cfapi_config('database/connection') }
it { is_expected.to_not contain_murano_cfapi_config('database/idle_timeout') }
it { is_expected.to_not contain_murano_cfapi_config('database/min_pool_size') }
it { is_expected.to_not contain_murano_cfapi_config('database/max_retries') }
it { is_expected.to_not contain_murano_cfapi_config('database/retry_interval') }
it { is_expected.to_not contain_murano_cfapi_config('database/max_pool_size') }
@@ -19,7 +18,6 @@ describe 'murano::db_cfapi' do
let :params do
{ :database_connection => 'mysql+pymysql://murano_cfapi:murano_cfapi@localhost/murano_cfapi',
:database_idle_timeout => '3601',
:database_min_pool_size => '2',
:database_max_retries => '11',
:database_retry_interval => '11',
:database_max_pool_size => '11',
@@ -31,7 +29,6 @@ describe 'murano::db_cfapi' do
it { should contain_oslo__db('murano_cfapi_config').with(
:connection => 'mysql+pymysql://murano_cfapi:murano_cfapi@localhost/murano_cfapi',
:idle_timeout => '3601',
:min_pool_size => '2',
:max_pool_size => '11',
:max_retries => '11',
:retry_interval => '11',


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

@@ -7,7 +7,6 @@ describe 'murano::db' do
:db_max_retries => '<SERVICE DEFAULT>',
:connection => 'mysql+pymysql://murano:secrete@localhost:3306/murano',
:connection_recycle_time => '<SERVICE DEFAULT>',
:min_pool_size => '<SERVICE DEFAULT>',
:max_pool_size => '<SERVICE DEFAULT>',
:max_retries => '<SERVICE DEFAULT>',
:retry_interval => '<SERVICE DEFAULT>',
@@ -21,7 +20,6 @@ describe 'murano::db' do
{
:database_connection => 'mysql+pymysql://murano:murano@localhost/murano',
:database_connection_recycle_time => '3601',
:database_min_pool_size => '2',
:database_max_retries => '11',
:database_retry_interval => '11',
:database_max_pool_size => '11',
@@ -35,7 +33,6 @@ describe 'murano::db' do
:db_max_retries => '-1',
:connection => 'mysql+pymysql://murano:murano@localhost/murano',
:connection_recycle_time => '3601',
:min_pool_size => '2',
:max_pool_size => '11',
:max_retries => '11',
:retry_interval => '11',


Loading…
Cancel
Save