Skip to content

Conversation

@MichaelConrad
Copy link
Contributor

Replaces #204

  • Add configuration template for PostgreSQL 9.6
  • Update variables and comments in defaults/main.yml
  • Update test.yml to use 9.6
  • Add role options for 9.6 to .travis.yml
  • Update the 2.x version of Ansible in .travis.yml to 2.1.2.0
  • Use specific release numbers for each distribution / version

@MichaelConrad
Copy link
Contributor Author

Hi @arturmartins, regarding your comment on #204:

Could you add [*] as default value of postgresql_synchronous_standby_names, please?

Wouldn't this default to synchronous mode being enforced on all standbys?

By default, I believe this should be an empty string (or list, in this case) per the PostgreSQL default:

If no synchronous standby names are specified here, then synchronous replication is not enabled and transaction commits will not wait for replication.

I may have added another commit after your first comment which addressed the issue with the defaults in a different manor:

defaults/main.yml

postgresql_synchronous_standby_num_sync: ''
postgresql_synchronous_standby_names: [] # '*' means 'all'

templates/postgresql.conf-9.6.j2

synchronous_standby_names = '{{postgresql_synchronous_standby_num_sync}}{% if postgresql_synchronous_standby_names != [] %} ({{postgresql_synchronous_standby_names|join(',')}}){% endif %}'    # standby servers that provide sync rep
                # number of sync standbys and comma-separated list of application_name
                # from standby(s); '*' = all

The default would now be:

synchronous_standby_names = ''  # standby servers that provide sync rep
                                # number of sync standbys and comma-separated list of application_name
                                # from standby(s); '*' = all

Which would match the PostgreSQL default.

This will also have no impact on the defaults which are set for prior versions of PostgreSQL that use synchronous_standby_names.

Copy link
Contributor

@sebalix sebalix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Thanks for the work

@lhoss
Copy link

lhoss commented Nov 14, 2016

any chance getting this nice upgrade PR merged to master soon ? @otakup0pe ?

@sebalix
Copy link
Contributor

sebalix commented Nov 14, 2016

Indeed, the 9.6 release will be heavily asked/required by people soon. Minor fixes could be applied after the PR is merged.

@bcoe
Copy link

bcoe commented Nov 21, 2016

@otakup0pe any chance of seeing this land soon? would love to roll this out at work without working from a fork.

@MichaelConrad
Copy link
Contributor Author

I have been running PostgreSQL 9.6 with this for a few weeks and have yet to encounter any issues. If anyone discovers any changes to be made please let me know and I will update the PR.

@thbar
Copy link
Contributor

thbar commented Nov 30, 2016

@MichaelConrad thanks for your feedback on this, will try it out very soon. I wonder if you used a playbook to handle the upgrade? (or maybe it wasn't an upgrade in your case).

@lhoss
Copy link

lhoss commented Nov 30, 2016

nice to hear @MichaelConrad !
will myself test it ASAP (mostly for the 9.6 configure part) using n a custom branch merging your PR and ontop #213 to test for our postgres(9.6)-in-docker deployments

I hope after 1-2 more positive feedbacks here, we can get @otakup0pe to merge this finally (requiring less custom branches etc)

@lhoss
Copy link

lhoss commented Nov 30, 2016

Actually, it works nicely for me (tested with the 3 tags -t postgresql-configure,postgresql-users,postgresql-databases , deploying an updated config in our 9.6 postgres(+postgis) docker container) !

@MichaelConrad After I compared the diffs (ansible --diff to the rescue) between the default pg 9.6 config and the one deployed by the role, I found a number of diffs, but only one of these was introduced with the new 9.6 config settings:

  • +wal_log_hints = False
    I propose to use on/off as done for the (pre-9.6) wal_compression in the 9.6 template:
wal_compression = {{ 'on' if postgresql_wal_compression else 'off' }}
wal_log_hints = {{postgresql_wal_log_hints}}			# also do full page writes of non-critical updates

not really changing the logic though 👍
Also I found an existing case (found in the templates back to v9.4), that does not do the 'on/off' mapping either:

ssl_prefer_server_ciphers = {{postgresql_ssl_prefer_server_ciphers}}		# (change requires restart)

Finally found 2 default postgres settings, that got removed, because not in the 9.6 template (It seems these were only supported by the role upto v9.2. No idea why, as these are still in the original postgres configs) :

-#gin_fuzzy_search_limit = 0
-#gin_pending_list_limit = 4MB

@vividvilla
Copy link

Works fine for me. Any idea when this will be merged with the master?

@vividvilla
Copy link

I am actually getting error while copying the postgresql.conf template. Its looking for config template in my local directory.

TASK [MichaelConrad.postgresql : PostgreSQL | Update configuration - pt. 2 (postgresql.conf)] ***
fatal: [127.0.0.1]: FAILED! => {"changed": false, "failed": true, "msg": "IOError: [Errno 2] No such file or directory: u'/Users/vivek/ansible/ubuntu/postgresql.conf-9.6.j2'"}

@lhoss
Copy link

lhoss commented Dec 15, 2016

yes plz get it merged (maybe if some more people review it)
I just found a minor thing to improve ( @MichaelConrad could you fix wal_log_hints , see my review above)

@vividvilla btw what ansible version?
I recommend to double-check that your local role/branch copy (I assume you used ansible-galaxy with a git+httpsurl) really has the right branch, and thus the required template file postgresql.conf-9.6.j2 .
Note that the ansible No such file or directory: can get confusing, as ansible tries multiple folders that could contain a file from a role, and usually checks the current working directory last..

@Envek
Copy link

Envek commented Dec 15, 2016

Actually ansible-galaxy won't notice that you've changed requirements.yml and will not reinstall a role (what the shame!).

So to use it version you need to have in your requirements.yml:

- src: https://github.com/MichaelConrad/postgresql
  version: implement_postgresql_9_6
  name: ANXS.postgresql

and then execute:

ansible-galaxy remove ANXS.postgresql
ansible-galaxy install -r requirements.yml

I'm using this branch too and it works fine for me.

@lhoss
Copy link

lhoss commented Dec 15, 2016

Actually ansible-galaxy won't notice that you've changed requirements.yml and will not reinstall a role (what the shame!).

Yeah! (I guess we are thousands of ansible users shaking their head on that)
Or you force ansible in kind of an upgrade mode using -f/--force ! (but WHY not making this existing logic more explicit, without 'forcing' any unplanned behaviour!?)

@ernestas-poskus
Copy link

when this will be merged ?

@MichaelConrad
Copy link
Contributor Author

@lhoss, I went ahead and implemented the changes you recommended for the postgresql_wal_log_hints and postgresql_ssl_prefer_server_ciphers variables.

Please let me know if you find anything else and I will make changes as necessary. Thanks again for your detailed analysis!

@lhoss
Copy link

lhoss commented Jan 2, 2017

LGTM now, thx @MichaelConrad 👍
now let's get this PR merged !
@otakup0pe ?! (this repos needs more 'owners' , maybe @ernestas-poskus ? who is managing a number of ANXS repos' like zookeeper, mesos, marathon... )

@pinak1180
Copy link

@MichaelConrad thanks for your awesome work, Any idea when this will be merged with the master?

@ernestas-poskus
Copy link

ping @pjan @farridav @jesselang @sebalix

@otakup0pe
Copy link
Member

This is amazing work! I don't have time to personally validate this, but there seems to be a ton of interest so.... It seems like others have tested this and it works, so unless someone tells me otherwise I'm going to merge it.

As well.... We are looking for people to help maintain some Ansible roles! A few people who are interested in helping with the backlog of this particular role would be very much appreciated...

@MichaelConrad
Copy link
Contributor Author

@otakup0pe, I would be very much willing to help contribute / maintain this role (and potentially others) in any capacity. Please let me know how I can help.

@lhoss
Copy link

lhoss commented Jan 23, 2017

I'ld also be willing but I am sure others qualified (like this PR's owner Michael) are better suited (+have more capacity) as I'm already quite busy contributing to https://github.com/AnsibleShipyard roles (mainly zookeeper, mesos, marathon) 👍

@otakup0pe otakup0pe merged commit 0ed39ed into ANXS:master Jan 30, 2017
@otakup0pe
Copy link
Member

@MichaelConrad if you can email me, we can get you setup as a maintainer :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.