From bd1cea70f852128846e31f9b7417e605e51cded1 Mon Sep 17 00:00:00 2001 From: Gavin Didrichsen Primary 2019 Date: Sun, 3 Oct 2021 21:41:38 +0000 Subject: [PATCH] Ensure pe_databases::pg_repack class also purges old vaccum cron jobs Signed-off-by: Gavin Didrichsen --- manifests/pg_repack.pp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/manifests/pg_repack.pp b/manifests/pg_repack.pp index 37e0eb8..c19aaa5 100644 --- a/manifests/pg_repack.pp +++ b/manifests/pg_repack.pp @@ -61,12 +61,19 @@ } } - # Legacy cleanup + # Ensure legacy vaccum and pg_repack crons are purged. + # If someone upgrades from an ancient v0.x version of the pe_databases module to 2.0 or newer, + # the old cron jobs running vaccuum full will not be cleaned up. This can result in a deadlock + # when both pg_repack and vacuum full attempt to update a table $legacy_crons = [ 'pg_repack facts tables', 'pg_repack catalogs tables', 'pg_repack other tables', - 'pg_repack reports tables', 'pg_repack resource_events tables' + 'pg_repack reports tables', 'pg_repack resource_events tables', + 'VACUUM FULL facts tables', + 'VACUUM FULL catalogs tables', + 'VACUUM FULL other tables', + 'Maintain PE databases', ] cron { $legacy_crons: ensure => absent, - } } +}