Showing with 12 additions and 2 deletions.
  1. +10 −0 manifests/postgresql_settings.pp
  2. +1 −1 manifests/set_table_attribute.pp
  3. +1 −1 metadata.json
10 changes: 10 additions & 0 deletions manifests/postgresql_settings.pp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
Boolean $manage_postgresql_service = true,
Boolean $all_in_one_pe_install = true,
Boolean $manage_fact_values_autovacuum_cost_delay = true,
Optional[Float[0,1]] $factsets_autovacuum_vacuum_scale_factor = 0.80,
String $maintenance_work_mem = $all_in_one_pe_install ? {
false => "${::memory['system']['total_bytes'] / 1024 / 1024 / 3}MB",
true => "${::memory['system']['total_bytes'] / 1024 / 1024 / 8}MB",
Expand Down Expand Up @@ -106,4 +107,13 @@
if $manage_fact_values_autovacuum_cost_delay {
pe_databases::set_puppetdb_table_autovacuum_cost_delay_zero { 'fact_values' : }
}

if !empty($factsets_autovacuum_vacuum_scale_factor) {
pe_databases::set_table_attribute { "Set autovacuum_vacuum_scale_factor=${factsets_autovacuum_vacuum_scale_factor} for factsets" :
db => 'pe-puppetdb',
table_name => 'factsets',
table_attribute => 'autovacuum_vacuum_scale_factor',
table_attribute_value => "${factsets_autovacuum_vacuum_scale_factor}",
}
}
}
2 changes: 1 addition & 1 deletion manifests/set_table_attribute.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
) {

postgresql_psql { "Set ${table_attribute}=${table_attribute_value} for ${table_name}" :
command => "ALTER TABLE ${table_name} SET ( ${table_attribute} = 0 )",
command => "ALTER TABLE ${table_name} SET ( ${table_attribute} = ${table_attribute_value} )",
unless => "SELECT reloptions FROM pg_class WHERE relname = '${table_name}' AND CAST(reloptions as text) LIKE '%${table_attribute}=${table_attribute_value}%'",
db => $db,
psql_user => 'pe-postgres',
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "npwalker/pe_databases",
"version": "0.8.1",
"version": "0.9.0",
"author": "npwalker",
"summary": "A Puppet Module for Backing Up / Maintaining / Tuning Your Puppet Enterprise Databases",
"license": "Apache-2.0",
Expand Down