Skip to content

Commit

Permalink
Merge pull request #300 from gclough/sync_standby_v9.6_syntax
Browse files Browse the repository at this point in the history
Updated synchronous_standby_names to be correct
  • Loading branch information
UnderGreen authored Apr 27, 2018
2 parents 643e19a + 01293e1 commit d0cc433
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,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_num_sync: "" # >= 9.6 (NOTE: If you use the ANY/ALL syntax in v10, then note the new variable below)
postgresql_synchronous_standby_choose_sync: "FIRST" # >= 10
postgresql_synchronous_standby_names: [] # '*' means 'all'

# number of xacts by which cleanup is delayed
Expand Down
2 changes: 1 addition & 1 deletion templates/postgresql.conf-10.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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
# method to choose sync standbys, number of sync standbys,
# and comma-separated list of application_name
# from standby(s); '*' = all
Expand Down
2 changes: 1 addition & 1 deletion templates/postgresql.conf-9.1.j2
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ wal_sender_delay = {{postgresql_wal_sender_delay}} # walsender cycle time, 1-10
wal_keep_segments = {{postgresql_wal_keep_segments}} # in logfile segments, 16MB each; 0 disables
vacuum_defer_cleanup_age = {{postgresql_vacuum_defer_cleanup_age}} # number of xacts by which cleanup is delayed
replication_timeout = {{postgresql_replication_timeout or postgresql_wal_sender_timeout}} # in milliseconds; 0 disables
synchronous_standby_names = '{{postgresql_synchronous_standby_names|join(',')}}' # standby servers that provide sync rep
synchronous_standby_names = '{% if postgresql_synchronous_standby_names != [] %}"{{postgresql_synchronous_standby_names|join('\",\"')}}"{% endif %}' # standby servers that provide sync rep
# comma-separated list of application_name
# from standby(s); '*' = all

Expand Down
2 changes: 1 addition & 1 deletion templates/postgresql.conf-9.2.j2
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ replication_timeout = {{postgresql_replication_timeout or postgresql_wal_sender_

# These settings are ignored on a standby server.

synchronous_standby_names = '{{postgresql_synchronous_standby_names|join(',')}}' # standby servers that provide sync rep
synchronous_standby_names = '{% if postgresql_synchronous_standby_names != [] %}"{{postgresql_synchronous_standby_names|join('\",\"')}}"{% endif %}' # standby servers that provide sync rep
# comma-separated list of application_name
# from standby(s); '*' = all
vacuum_defer_cleanup_age = {{postgresql_vacuum_defer_cleanup_age}} # number of xacts by which cleanup is delayed
Expand Down
2 changes: 1 addition & 1 deletion templates/postgresql.conf-9.3.j2
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ wal_sender_timeout = {{postgresql_wal_sender_timeout}} # in milliseconds; 0 disa

# These settings are ignored on a standby server.

synchronous_standby_names = '{{postgresql_synchronous_standby_names|join(',')}}' # standby servers that provide sync rep
synchronous_standby_names = '{% if postgresql_synchronous_standby_names != [] %}"{{postgresql_synchronous_standby_names|join('\",\"')}}"{% endif %}' # standby servers that provide sync rep
# comma-separated list of application_name
# from standby(s); '*' = all
vacuum_defer_cleanup_age = {{postgresql_vacuum_defer_cleanup_age}} # number of xacts by which cleanup is delayed
Expand Down
2 changes: 1 addition & 1 deletion templates/postgresql.conf-9.4.j2
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ max_replication_slots = {{postgresql_max_replication_slots}} # max number of rep

# These settings are ignored on a standby server.

synchronous_standby_names = '{{postgresql_synchronous_standby_names|join(',')}}' # standby servers that provide sync rep
synchronous_standby_names = '{% if postgresql_synchronous_standby_names != [] %}"{{postgresql_synchronous_standby_names|join('\",\"')}}"{% endif %}' # standby servers that provide sync rep
# comma-separated list of application_name
# from standby(s); '*' = all
vacuum_defer_cleanup_age = {{postgresql_vacuum_defer_cleanup_age}} # number of xacts by which cleanup is delayed
Expand Down
2 changes: 1 addition & 1 deletion templates/postgresql.conf-9.5.j2
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,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_names|join(',')}}' # standby servers that provide sync rep
synchronous_standby_names = '{% if postgresql_synchronous_standby_names != [] %}"{{postgresql_synchronous_standby_names|join('\",\"')}}"{% endif %}' # standby servers that provide sync rep
# comma-separated list of application_name
# from standby(s); '*' = all
vacuum_defer_cleanup_age = {{postgresql_vacuum_defer_cleanup_age}} # number of xacts by which cleanup is delayed
Expand Down
2 changes: 1 addition & 1 deletion templates/postgresql.conf-9.6.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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
# number of sync standbys and comma-separated list of application_name
# from standby(s); '*' = all
vacuum_defer_cleanup_age = {{postgresql_vacuum_defer_cleanup_age}} # number of xacts by which cleanup is delayed
Expand Down

0 comments on commit d0cc433

Please sign in to comment.