-
Notifications
You must be signed in to change notification settings - Fork 581
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
Updated synchronous_standby_names to be correct #300
Conversation
How do I resubmit this to Travis... as it seems to have failed on their end? |
2b538dc
to
3ff3868
Compare
@WolfgangPecho , can you verify this update is correct for v10. I'm pretty sure it is, as I've test it and it matches the doco. |
templates/postgresql.conf-10.j2
Outdated
@@ -251,7 +251,7 @@ track_commit_timestamp = {{'on' if postgresql_track_commit_timestamp else 'off' | |||
|
|||
# These settings are ignored on a standby server. | |||
|
|||
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 | |||
synchronous_standby_names = '{% if postgresql_synchronous_standby_names != [] %}{% if postgresql_synchronous_standby_choose_sync != "" and postgresql_synchronous_standby_num_sync != "" %}{{ postgresql_synchronous_standby_choose_sync }} {% endif %}{% if postgresql_synchronous_standby_num_sync != "" %}{{ postgresql_synchronous_standby_num_sync }} ({% endif %}{{ postgresql_synchronous_standby_names | join(',') }}{% if postgresql_synchronous_standby_num_sync != "" %}){% endif %}{% endif %}' # standby servers that provide sync rep |
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.
This is the new v10 syntax.
templates/postgresql.conf-9.6.j2
Outdated
@@ -244,7 +244,7 @@ track_commit_timestamp = {{'on' if postgresql_track_commit_timestamp else 'off' | |||
|
|||
# These settings are ignored on a standby server. | |||
|
|||
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 | |||
synchronous_standby_names = '{% if postgresql_synchronous_standby_names != [] %}{% if postgresql_synchronous_standby_num_sync != "" %}{{ postgresql_synchronous_standby_num_sync }} ({% endif %}{{ postgresql_synchronous_standby_names | join(',') }}{% if postgresql_synchronous_standby_num_sync != "" %}){% endif %}{% endif %}' # standby servers that provide sync rep |
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.
This is the v9.6 syntax... which is different from anything <= 9.5, but is also different from v10. It's unique, and only for this one version of PostgreSQL.
defaults/main.yml
Outdated
@@ -297,7 +297,8 @@ postgresql_track_commit_timestamp: off # (>= 9.5) | |||
|
|||
# standby servers that provide sync rep. | |||
# number of sync standbys (>= 9.6) and comma-separated list of application_name from standby(s) | |||
postgresql_synchronous_standby_num_sync: "" | |||
postgresql_synchronous_standby_choose_sync: "FIRST" #>= 10 | |||
postgresql_synchronous_standby_num_sync: "" # >= 9.6 |
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.
New parameters required for v9.6, and v10
That's great, thanks @WolfgangPecho . Hopefully this will be verified and merged soon, as the sync standby handling is one of the good features in v9.6 and v10. |
e8db5ab
to
39b9d5b
Compare
I've done some testing, to merge in the "quoted" hostnames, as raised in #337: Using PostgreSQL v9.3, and two sync standby's: Gives: v9.3, No sync: Gives:
v9.6, two sync: Gives: v9.6, no sync: Gives: v10, two sync: Gives: v10, No sync: Gives: |
ef19c02
to
5d4fa50
Compare
@jlozadad ... I merged in a fix from #338 by @hakoerber ... but I'm not sure how to give attribution? If you could help I'd appreciate it. |
no idea either. you can remove the commit if you want. |
It's fine. Just wanted to tell you that I think unusual to incorporate fixes from other people's merge requests into your commits. Anyway, the merge request looks good to me apart from two small issues: We need documentation about postgresql_synchronous_standby_num_sync: "ANY 1" to postgresql_synchronous_standby_num_sync: "1"
postgresql_synchronous_standby_choose_sync: "ANY" I like the second way much better, it just has to be documented properly I think. Secondly, the diff is now quite huge due to the merge commit. When I do a git diff upstream/master gclough/sync_standby_v9.6_syntax I get a much nicer patch. Maybe it is a good idea to make completely new commits with this patch and commit them? |
Good idea. I’m still quite new to GIT and have a little trouble squashing commits. Would you like to do that, and commit it back? That way it will retain the credit that we both worked on this, right? I see what you're saying about the backwards compatibility... but as the v10 merge was only pushed 14 days ago, is it a big issue? Would you prefer to see it documented in the |
f7852b0
to
81c74df
Compare
@hakoerber ... I'm not sure why, but my local "master" is a bit goofy. I've got a lot of PR's in progress, otherwise I'd blow it away and start again. :o( I think I've pared it down to a minimal commit, and whenever I try to squash those commits into one then it fails the auto-merge. If this isn't right, then please squash them and re-commit it under your account, as this will tag your username in this PR too, right? |
ccb1bf6
to
ed90cd1
Compare
@gclough is the PR ready for merge? |
Yes, I believe so. This allows the v10 syntax to be used without a kludge. Is there any way to attribute @hakoerber too, as he contributed to this via #338? |
Fixes #269
Updated synchronous_standby_names to be correct, even when
{{ postgresql_synchronous_standby_num_sync }}
isn't specified.https://www.postgresql.org/docs/9.6/static/runtime-config-replication.html
This parameter specifies a list of standby servers using either of the following syntaxes: