Skip to content

Commit 20c7d82

Browse files
coreymbeMartyEwings
authored andcommitted
Changes to pg_repack.pp and pg_repack_spec.rb per SUP-2405
1 parent f147ba2 commit 20c7d82

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

manifests/maintenance/pg_repack.pp

+15
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
$other_tables = '-t producers -t resource_params -t resource_params_cache"'
3131
$reports_table = '-t reports"'
3232
$resource_events_table = '-t resource_events"'
33+
$catalog_inputs_table = '-t catalog_inputs"'
3334

3435
Cron {
3536
ensure => $ensure_cron,
@@ -58,6 +59,20 @@
5859
command => "${repack} ${repack_jobs} ${other_tables} > ${logging_directory}/other_repack.log 2>&1",
5960
}
6061

62+
if versioncmp($facts['pe_server_version'], '2019.8.0') >= 0 {
63+
cron { 'pg_repack catalog_inputs tables' :
64+
monthday => 5,
65+
hour => 5,
66+
minute => 30,
67+
command => "${repack} ${repack_jobs} ${catalog_inputs_table} > ${logging_directory}/catalog_inputs_repack.log 2>&1",
68+
}
69+
}
70+
else {
71+
cron { 'pg_repack catalog_inputs tables' :
72+
ensure => 'absent',
73+
}
74+
}
75+
6176
if versioncmp($facts['pe_server_version'], '2019.7.0') < 0 {
6277
cron { 'pg_repack reports tables' :
6378
monthday => 10,

spec/classes/maintenance/pg_repack_spec.rb

+11
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,17 @@
7171
' -d pe-puppetdb --jobs 2 -t resource_events" > /var/log/puppetlabs/pe_databases_cron/resource_events_repack.log 2>&1')
7272
}
7373
end
74+
context 'on >= PE 2019.8.0' do
75+
before :each do
76+
facts['pe_server_version'] = '2019.8.0'
77+
facts['pe_postgresql_info']['installed_server_version'] = 11
78+
end
79+
it {
80+
is_expected.to contain_cron('pg_repack catalog_inputs tables')
81+
.with_command('su - pe-postgres -s /bin/bash -c "/opt/puppetlabs/server/apps/postgresql/11/bin/pg_repack'\
82+
' -d pe-puppetdb --jobs 2 -t catalog_inputs" > /var/log/puppetlabs/pe_databases_cron/catalog_inputs_repack.log 2>&1')
83+
}
84+
end
7485
end
7586
end
7687
end

0 commit comments

Comments
 (0)