Skip to content
Snippets Groups Projects
Verified Commit 37633e48 authored by Yorick Peterse's avatar Yorick Peterse
Browse files

Allow setting of synchronous replication settings

This adds support for setting "synchronous_commit" and
"synchronous_standby_names" in PostgreSQL. These settings can be used to
enable and control synchronous replication behaviour.
parent 44dbae77
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -10,6 +10,8 @@ are not the same (O Schwede) 62b5cc
 
8.17.0
 
- Add support for setting PostgreSQL's synchronous_commit and
synchronous_standby_names settings
- Remove deprecated Elasticsearch configuration options ab660c56
- Include GitLab Pages in the Community Edition
- Add HealthCheck support to our Docker image 845b52b2
Loading
Loading
Loading
Loading
@@ -611,6 +611,8 @@ external_url 'GENERATED_EXTERNAL_URL'
# postgresql['max_standby_archive_delay'] = "30s"
# postgresql['max_standby_streaming_delay'] = "30s"
# postgresql['max_replication_slots'] = 0
# postgresql['synchronous_commit'] = on
# postgresql['synchronous_standby_names'] = ''
 
# Backup/Archive settings
# default['gitlab']['postgresql']['archive_mode'] = "off"
Loading
Loading
Loading
Loading
@@ -411,6 +411,8 @@ default['gitlab']['postgresql']['hot_standby'] = "off"
default['gitlab']['postgresql']['max_standby_archive_delay'] = "30s"
default['gitlab']['postgresql']['max_standby_streaming_delay'] = "30s"
default['gitlab']['postgresql']['max_replication_slots'] = 0
default['gitlab']['postgresql']['synchronous_commit'] = 'on'
default['gitlab']['postgresql']['synchronous_standby_names'] = ''
 
# Backup/Archive settings
default['gitlab']['postgresql']['archive_mode'] = "off"
Loading
Loading
Loading
Loading
@@ -161,7 +161,8 @@ shared_preload_libraries = '<%= node['gitlab']['postgresql']['shared_preload_lib
wal_level = <%= node['gitlab']['postgresql']['wal_level'] %>
# (change requires restart)
#fsync = on # turns forced synchronization on or off
#synchronous_commit = on # synchronization level; on, off, or local
synchronous_commit = <%= node['gitlab']['postgresql']['synchronous_commit'] %> # synchronization level; on, off, or local
synchronous_standby_names = '<%= node['gitlab']['postgresql']['synchronous_standby_names'] %>'
#wal_sync_method = fsync # the default is the first option
# supported by the operating system:
# open_datasync
Loading
Loading
Loading
Loading
@@ -209,6 +209,24 @@ describe 'postgresql 9.6' do
).with_content(/max_replication_slots = 0/)
end
 
it 'sets the synchronous_commit setting' do
expect(chef_run.node['gitlab']['postgresql']['synchronous_commit'])
.to eq('on')
expect(chef_run).to render_file(
'/var/opt/gitlab/postgresql/data/postgresql.conf'
).with_content(/synchronous_commit = on/)
end
it 'sets the synchronous_commit setting' do
expect(chef_run.node['gitlab']['postgresql']['synchronous_standby_names'])
.to eq('')
expect(chef_run).to render_file(
'/var/opt/gitlab/postgresql/data/postgresql.conf'
).with_content(/synchronous_standby_names = ''/)
end
context 'running version differs from data version' do
before do
allow_any_instance_of(PgHelper).to receive(:version).and_return('9.2.18')
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment