Skip to content
Snippets Groups Projects
Commit 691027fd authored by Yorick Peterse's avatar Yorick Peterse Committed by Marin Jankovski
Browse files

Add support for various PostgreSQL settings

parent 67a5c6a7
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -9,6 +9,7 @@ omnibus-gitlab repository.
 
9.1.0
 
- Add support for the following PostgreSQL settings: random_page_cost, max_locks_per_transaction, log_temp_files, log_checkpoints
- Remove deprecated satellites configuration f88ba40b
- Add configuration file for Gitaly 7c7c728
- Add support for Gitaly address per shard 2096928
Loading
Loading
Loading
Loading
@@ -637,6 +637,10 @@ external_url 'GENERATED_EXTERNAL_URL'
# postgresql['synchronous_commit'] = on
# postgresql['synchronous_standby_names'] = ''
# postgresql['hot_standby_feedback'] = 'off'
# postgresql['random_page_cost'] = 4.0
# postgresql['max_locks_per_transaction'] = 64
# postgresql['log_temp_files'] = -1
# postgresql['log_checkpoints'] = 'off'
 
# Backup/Archive settings
# default['gitlab']['postgresql']['archive_mode'] = "off"
Loading
Loading
Loading
Loading
@@ -400,6 +400,10 @@ default['gitlab']['postgresql']['log_line_prefix'] = nil
default['gitlab']['postgresql']['track_activity_query_size'] = "1024"
default['gitlab']['postgresql']['shared_preload_libraries'] = nil
default['gitlab']['postgresql']['dynamic_shared_memory_type'] = nil
default['gitlab']['postgresql']['random_page_cost'] = 4.0
default['gitlab']['postgresql']['max_locks_per_transaction'] = 64
default['gitlab']['postgresql']['log_temp_files'] = -1
default['gitlab']['postgresql']['log_checkpoints'] = 'off'
 
# Replication settings
default['gitlab']['postgresql']['sql_replication_user'] = "gitlab_replicator"
Loading
Loading
Loading
Loading
@@ -263,7 +263,9 @@ hot_standby_feedback = <%= @hot_standby_feedback %> # send info from standby t
# - Planner Cost Constants -
 
#seq_page_cost = 1.0 # measured on an arbitrary scale
#random_page_cost = 4.0 # same scale as above
<% if @random_page_cost %>
random_page_cost = <%= @random_page_cost %> # same scale as above
<% end %>
#cpu_tuple_cost = 0.01 # same scale as above
#cpu_index_tuple_cost = 0.005 # same scale as above
#cpu_operator_cost = 0.0025 # same scale as above
Loading
Loading
@@ -390,7 +392,9 @@ log_min_duration_statement = <%= @log_min_duration_statement %> # -1 is disable
#debug_print_rewritten = off
#debug_print_plan = off
#debug_pretty_print = on
#log_checkpoints = off
<% if @log_checkpoints %>
log_checkpoints = <%= @log_checkpoints %>
<% end %>
#log_connections = off
#log_disconnections = off
#log_duration = off
Loading
Loading
@@ -417,9 +421,11 @@ log_line_prefix = '<%= @log_line_prefix %>' # default '', special values:
# %% = '%'
#log_lock_waits = off # log lock waits >= deadlock_timeout
#log_statement = 'none' # none, ddl, mod, all
#log_temp_files = -1 # log temporary files equal or larger
<% if @log_temp_files %>
log_temp_files = <%= @log_temp_files %> # log temporary files equal or larger
# than the specified size in kilobytes;
# -1 disables, 0 logs all temp files
<% end %>
#log_timezone = '(defaults to server environment setting)'
 
 
Loading
Loading
@@ -533,11 +539,13 @@ default_text_search_config = 'pg_catalog.english'
#------------------------------------------------------------------------------
 
#deadlock_timeout = 1s
#max_locks_per_transaction = 64 # min 10
<% if @max_locks_per_transaction %>
max_locks_per_transaction = <%= @max_locks_per_transaction %> # min 10
# (change requires restart)
# Note: Each lock table slot uses ~270 bytes of shared memory, and there are
# max_locks_per_transaction * (max_connections + max_prepared_transactions)
# lock table slots.
<% end %>
#max_pred_locks_per_transaction = 64 # min 10
# (change requires restart)
 
Loading
Loading
Loading
Loading
@@ -242,6 +242,42 @@ describe 'postgresql 9.6' do
).with_content(/hot_standby_feedback = off/)
end
 
it 'sets the random_page_cost setting' do
expect(chef_run.node['gitlab']['postgresql']['random_page_cost'])
.to eq(4.0)
expect(chef_run).to render_file(
'/var/opt/gitlab/postgresql/data/postgresql.conf'
).with_content(/random_page_cost = 4\.0/)
end
it 'sets the max_locks_per_transaction setting' do
expect(chef_run.node['gitlab']['postgresql']['max_locks_per_transaction'])
.to eq(64)
expect(chef_run).to render_file(
'/var/opt/gitlab/postgresql/data/postgresql.conf'
).with_content(/max_locks_per_transaction = 64/)
end
it 'sets the log_temp_files setting' do
expect(chef_run.node['gitlab']['postgresql']['log_temp_files'])
.to eq(-1)
expect(chef_run).to render_file(
'/var/opt/gitlab/postgresql/data/postgresql.conf'
).with_content(/log_temp_files = -1/)
end
it 'sets the log_checkpoints setting' do
expect(chef_run.node['gitlab']['postgresql']['log_checkpoints'])
.to eq('off')
expect(chef_run).to render_file(
'/var/opt/gitlab/postgresql/data/postgresql.conf'
).with_content(/log_checkpoints = off/)
end
context 'when dynamic_shared_memory_type is none' do
before do
stub_gitlab_rb({
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