Manage the maximum-pool-size configuration parameter in database.ini
This commit is contained in:
parent
98821c294d
commit
46f1b03145
6 changed files with 72 additions and 39 deletions
|
@ -69,6 +69,8 @@ class puppetdb (
|
||||||
$temp_usage = $puppetdb::params::temp_usage,
|
$temp_usage = $puppetdb::params::temp_usage,
|
||||||
$certificate_whitelist_file = $puppetdb::params::certificate_whitelist_file,
|
$certificate_whitelist_file = $puppetdb::params::certificate_whitelist_file,
|
||||||
$certificate_whitelist = $puppetdb::params::certificate_whitelist,
|
$certificate_whitelist = $puppetdb::params::certificate_whitelist,
|
||||||
|
$database_max_pool_size = $puppetdb::params::database_max_pool_size,
|
||||||
|
$read_database_max_pool_size = $puppetdb::params::read_database_max_pool_size,
|
||||||
) inherits puppetdb::params {
|
) inherits puppetdb::params {
|
||||||
|
|
||||||
class { '::puppetdb::server':
|
class { '::puppetdb::server':
|
||||||
|
@ -136,6 +138,8 @@ class puppetdb (
|
||||||
temp_usage => $temp_usage,
|
temp_usage => $temp_usage,
|
||||||
certificate_whitelist_file => $certificate_whitelist_file,
|
certificate_whitelist_file => $certificate_whitelist_file,
|
||||||
certificate_whitelist => $certificate_whitelist,
|
certificate_whitelist => $certificate_whitelist,
|
||||||
|
database_max_pool_size => $database_max_pool_size,
|
||||||
|
read_database_max_pool_size => $read_database_max_pool_size,
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($database == 'postgres') {
|
if ($database == 'postgres') {
|
||||||
|
|
|
@ -28,6 +28,7 @@ class puppetdb::params inherits puppetdb::globals {
|
||||||
$database_ssl = undef
|
$database_ssl = undef
|
||||||
$jdbc_ssl_properties = ''
|
$jdbc_ssl_properties = ''
|
||||||
$database_validate = true
|
$database_validate = true
|
||||||
|
$database_max_pool_size = '25'
|
||||||
|
|
||||||
# These settings manage the various auto-deactivation and auto-purge settings
|
# These settings manage the various auto-deactivation and auto-purge settings
|
||||||
$node_ttl = '0s'
|
$node_ttl = '0s'
|
||||||
|
@ -57,6 +58,7 @@ class puppetdb::params inherits puppetdb::globals {
|
||||||
$read_conn_max_age = '60'
|
$read_conn_max_age = '60'
|
||||||
$read_conn_keep_alive = '45'
|
$read_conn_keep_alive = '45'
|
||||||
$read_conn_lifetime = '0'
|
$read_conn_lifetime = '0'
|
||||||
|
$read_database_max_pool_size = '25'
|
||||||
|
|
||||||
$manage_firewall = true
|
$manage_firewall = true
|
||||||
$java_args = {}
|
$java_args = {}
|
||||||
|
|
|
@ -64,6 +64,8 @@ class puppetdb::server (
|
||||||
$temp_usage = $puppetdb::params::temp_usage,
|
$temp_usage = $puppetdb::params::temp_usage,
|
||||||
$certificate_whitelist_file = $puppetdb::params::certificate_whitelist_file,
|
$certificate_whitelist_file = $puppetdb::params::certificate_whitelist_file,
|
||||||
$certificate_whitelist = $puppetdb::params::certificate_whitelist,
|
$certificate_whitelist = $puppetdb::params::certificate_whitelist,
|
||||||
|
$database_max_pool_size = $puppetdb::params::database_max_pool_size,
|
||||||
|
$read_database_max_pool_size = $puppetdb::params::read_database_max_pool_size,
|
||||||
) inherits puppetdb::params {
|
) inherits puppetdb::params {
|
||||||
# deprecation warnings
|
# deprecation warnings
|
||||||
if $database_ssl != undef {
|
if $database_ssl != undef {
|
||||||
|
@ -151,6 +153,7 @@ class puppetdb::server (
|
||||||
database_password => $database_password,
|
database_password => $database_password,
|
||||||
database_name => $database_name,
|
database_name => $database_name,
|
||||||
database_ssl => $database_ssl,
|
database_ssl => $database_ssl,
|
||||||
|
database_max_pool_size => $database_max_pool_size,
|
||||||
jdbc_ssl_properties => $jdbc_ssl_properties,
|
jdbc_ssl_properties => $jdbc_ssl_properties,
|
||||||
database_validate => $database_validate,
|
database_validate => $database_validate,
|
||||||
database_embedded_path => $database_embedded_path,
|
database_embedded_path => $database_embedded_path,
|
||||||
|
@ -174,6 +177,7 @@ class puppetdb::server (
|
||||||
database_password => $read_database_password,
|
database_password => $read_database_password,
|
||||||
database_name => $read_database_name,
|
database_name => $read_database_name,
|
||||||
database_ssl => $read_database_ssl,
|
database_ssl => $read_database_ssl,
|
||||||
|
database_max_pool_size => $read_database_max_pool_size,
|
||||||
jdbc_ssl_properties => $read_database_jdbc_ssl_properties,
|
jdbc_ssl_properties => $read_database_jdbc_ssl_properties,
|
||||||
database_validate => $read_database_validate,
|
database_validate => $read_database_validate,
|
||||||
log_slow_statements => $read_log_slow_statements,
|
log_slow_statements => $read_log_slow_statements,
|
||||||
|
|
|
@ -19,6 +19,7 @@ class puppetdb::server::database (
|
||||||
$conn_keep_alive = $puppetdb::params::conn_keep_alive,
|
$conn_keep_alive = $puppetdb::params::conn_keep_alive,
|
||||||
$conn_lifetime = $puppetdb::params::conn_lifetime,
|
$conn_lifetime = $puppetdb::params::conn_lifetime,
|
||||||
$confdir = $puppetdb::params::confdir,
|
$confdir = $puppetdb::params::confdir,
|
||||||
|
$database_max_pool_size = $puppetdb::params::database_max_pool_size,
|
||||||
) inherits puppetdb::params {
|
) inherits puppetdb::params {
|
||||||
|
|
||||||
if str2bool($database_validate) {
|
if str2bool($database_validate) {
|
||||||
|
@ -147,4 +148,9 @@ class puppetdb::server::database (
|
||||||
setting => 'conn-lifetime',
|
setting => 'conn-lifetime',
|
||||||
value => $conn_lifetime,
|
value => $conn_lifetime,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ini_setting { 'puppetdb_database_max_pool_size':
|
||||||
|
setting => 'maximum-pool-size',
|
||||||
|
value => $database_max_pool_size,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@ class puppetdb::server::read_database (
|
||||||
$confdir = $puppetdb::params::confdir,
|
$confdir = $puppetdb::params::confdir,
|
||||||
$puppetdb_user = $puppetdb::params::puppetdb_user,
|
$puppetdb_user = $puppetdb::params::puppetdb_user,
|
||||||
$puppetdb_group = $puppetdb::params::puppetdb_group,
|
$puppetdb_group = $puppetdb::params::puppetdb_group,
|
||||||
|
$database_max_pool_size = $puppetdb::params::read_database_max_pool_size,
|
||||||
) inherits puppetdb::params {
|
) inherits puppetdb::params {
|
||||||
|
|
||||||
# Only add the read database configuration if database host is defined.
|
# Only add the read database configuration if database host is defined.
|
||||||
|
|
|
@ -118,6 +118,14 @@ describe 'puppetdb::server::database', :type => :class do
|
||||||
'setting' => 'conn-lifetime',
|
'setting' => 'conn-lifetime',
|
||||||
'value' => '0'
|
'value' => '0'
|
||||||
)}
|
)}
|
||||||
|
it { should contain_ini_setting('puppetdb_database_max_pool_size').
|
||||||
|
with(
|
||||||
|
'ensure' => 'present',
|
||||||
|
'path' => '/etc/puppetlabs/puppetdb/conf.d/database.ini',
|
||||||
|
'section' => 'database',
|
||||||
|
'setting' => 'maximum-pool-size',
|
||||||
|
'value' => '25'
|
||||||
|
)}
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'when using a legacy PuppetDB version' do
|
describe 'when using a legacy PuppetDB version' do
|
||||||
|
@ -226,6 +234,14 @@ describe 'puppetdb::server::database', :type => :class do
|
||||||
'setting' => 'conn-lifetime',
|
'setting' => 'conn-lifetime',
|
||||||
'value' => '0'
|
'value' => '0'
|
||||||
)}
|
)}
|
||||||
|
it { should contain_ini_setting('puppetdb_database_max_pool_size').
|
||||||
|
with(
|
||||||
|
'ensure' => 'present',
|
||||||
|
'path' => '/etc/puppetdb/conf.d/database.ini',
|
||||||
|
'section' => 'database',
|
||||||
|
'setting' => 'maximum-pool-size',
|
||||||
|
'value' => '25'
|
||||||
|
)}
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'when overriding database_path for embedded' do
|
describe 'when overriding database_path for embedded' do
|
||||||
|
|
Loading…
Reference in a new issue