-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add pg_repack as default maintenance strategy #25
Conversation
1b4bcf1
to
45c7fa4
Compare
ce0dfbf
to
833b87f
Compare
This spec test makes sure that the pg_repack class is included on versions of PE that support it and is not included on versions that do not support it.
833b87f
to
2e3b9b0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! 👍
$catalogs_tables = '-t catalogs -t catalog_resources -t edges -t certnames"' | ||
$other_tables = '-t producers -t resource_params -t resource_params_cache"' | ||
$reports_tables = '-t reports"' | ||
$logging = "> ${logging_directory}/output.log 2>&1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any logic to ensure that multiple repacks cannot be started simultaneously? That's the biggest danger of automated repacking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only ones that could overlap are the other tables and the reports table which run at 5:30 on 1 day of the month while facts and catalogs run at 4:30 2 days a week.
I'm not particularly concerned about them overlapping... but if we thought it was a serious concern then we could move the times they run further apart.
$ensure_cron = $disable_maintenace ? { | ||
true => absent, | ||
default => present | ||
#If the PE Version includes pg_repack (2018.1.7 and 2019.0.2) then use pg_repack and remove the old script and cron jobs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this instead check something more direct than PE Version, such as the existence of pg_repack itself?
Then, this module could be used with manual installs of pg_repack in older versions of PE.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Untested:
Facter.add(:pg_repack) do
confine Facter.value(:pe_postgresql_info)['installed_server_version'] => '9.6'
setcode do
cmd = %q(su - pe-postgres -s /bin/bash -c "/opt/puppetlabs/server/bin/psql -d pe-puppetdb -c 'SELECT * FROM pg_extension'")
res = Facter::Util::Resolution.exec(cmd)
res.include?('pg_repack')
end
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if someone really wants to use pg_repack on an older version of PE they can set manage_database_maintenance to false and then include the pg_repack manifest via a profile.
I don't suspect the use of manually installed pg_repack will be high in older installs.
2e3b9b0
to
a902adb
Compare
No description provided.