-
Notifications
You must be signed in to change notification settings - Fork 614
add parameter "version" to postgresql::server::extension to update the extension version #896
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
Conversation
…e extension version
Thanks, this would be very useful to have George, let us know if there's anything we can do to help get this merged @puppetlabs |
Hi @puppetlabs, just wondering if this could please be merged in as we're trying not to run off long-existing forks of official modules. Thanks, |
Issue is MODULES-5635 |
Fantastic PR many thanks @georgehansper !!! |
Thank you very much for merging this PR. |
@georgehansper Hi, I think that this PR is causing the behaviour seen at example42/psick#193, specifically:
It seems that it's quite possible for the |
It is possible for the psql command to run before postgres is started, but I don't think that the code in PR #896 is the cause of this problem. This is definitely not the case here, because the psql command which is failing explicitly includes the DB puppetdb.
The question I would ask is: Does the puppet run succeed because the version was rolled back, or just because it was run a second time (regardless of the version)? I have tried to reproduce the issue using:
But puppet always gets the ordering right. I suspect the problem is more likely related to the subsequent error message:
which might account for postgresql not being started, or failing soon after being started. FYI: Specifying |
So, I'm seeing a similar issue when running the PuppetDB module now, but only on hosts that have pulled in the new postgresql module. I think the problem is that the check and defined(Postgresql::Server::Database[$database]) is dependent on the manifest order. For example the puppetdb module defines the extension to be installed and then defines the database to install them into here. The PDB ordering is admittedly weird, but I do think that this causes a change in behavior by not complete auto-requiring dependent databases. |
Thanks @justinstoller for clarifying. @georgehansper Any thoughts? |
I suspect @justinstoller is right, and that using |
Hello @justinstoller @antgel I can reproduce the error message using the module puppetlabs-puppetdb I have created a new branch Before I create a pull-request, could you please verify that this branch also resolves the issue in your environment? Regards, |
@georgehansper Works for me, hope you can create a PR soon! :) |
Hi! Sorry, I've gotten a bit swamped, the change in your branch looks fine to me, but I don't have time to functionally test it. I've pinged the modules folks to see if they can work with you to get this across the line. |
Hi @justinstoller , @antgel I have submitted PR #932 to merge the code from https://github.com/infoxchange/puppetlabs-postgresql branch |
add parameter "version" to postgresql::server::extension to update the extension version
MODULES-5635
This change adds the parameter "version" to the defined type postgresql::server::extension
If unspecified, the module behaviour is unchanged.
If specified, the module will invoke the PostgreSQL-specific
ALTER EXTENSION...
version
may be set tolatest
, in which case the SQLALTER EXTENSION "extension" UPDATE
is applied to this database (only).version
may be set to a specific version, in which case the extension is updated usingALTER EXTENSION "extension" UPDATE TO 'version'
When an extension package is updated, this does not automatically change the effective version in each database. The
ALTER EXTENSION...
takes care of this on a per-database basis.