Skip to content
Snippets Groups Projects
Unverified Commit f5b27917 authored by Marin Jankovski's avatar Marin Jankovski Committed by Marin Jankovski
Browse files

Merge branch '2754-redis-persistence-settings' into 'master'

Add option to configure redis snapshotting

Closes #2754

See merge request !1964
parent 340e18cd
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -6,6 +6,8 @@ omnibus-gitlab repository.
10.0.2
 
- Fix an issue where enabling a GitLab Geo role would also disable all default services
- Update pg-upgrade output to be more clear when a bundled PostgreSQL is not in use
- Add option to configure redis snapshot frequency 400f3a54
 
10.0.1
 
Loading
Loading
Loading
Loading
@@ -786,6 +786,11 @@ external_url 'GENERATED_EXTERNAL_URL'
# redis['client_output_buffer_limit_slave'] = '256mb 64mb 60'
# redis['client_output_buffer_limit_pubsub'] = '32mb 8mb 60'
 
#####! Redis snapshotting frequency
#####! Set to [] to disable
#####! Set to [''] to clear previously set values
# redis['save'] = [ '900 1', '300 10', '60 10000' ]
################################################################################
## GitLab Web server
##! Docs: https://docs.gitlab.com/omnibus/settings/nginx.html#using-a-non-bundled-web-server
Loading
Loading
Loading
Loading
@@ -475,6 +475,7 @@ default['gitlab']['redis']['master_password'] = nil
default['gitlab']['redis']['client_output_buffer_limit_normal'] = "0 0 0"
default['gitlab']['redis']['client_output_buffer_limit_slave'] = "256mb 64mb 60"
default['gitlab']['redis']['client_output_buffer_limit_pubsub'] = "32mb 8mb 60"
default['gitlab']['redis']['save'] = ['900 1', '300 10', '60 10000']
 
####
# Web server
Loading
Loading
Loading
Loading
@@ -203,9 +203,15 @@ databases 16
#
# save ""
 
save 900 1
save 300 10
save 60 10000
<% unless @save.empty? %>
<% if @save.any?(&:empty?) %>
save ""
<% else %>
<% @save.each do |line| %>
<%= "save #{line}" %>
<% end %>
<% end %>
<% end %>
 
# By default Redis will stop accepting writes if RDB snapshots are enabled
# (at least one save point) and the latest background save failed.
Loading
Loading
Loading
Loading
@@ -15,6 +15,12 @@ describe 'gitlab::redis' do
.with_content(/client-output-buffer-limit slave 256mb 64mb 60/)
expect(chef_run).to render_file('/var/opt/gitlab/redis/redis.conf')
.with_content(/client-output-buffer-limit pubsub 32mb 8mb 60/)
expect(chef_run).to render_file('/var/opt/gitlab/redis/redis.conf')
.with_content(/^save 900 1/)
expect(chef_run).to render_file('/var/opt/gitlab/redis/redis.conf')
.with_content(/^save 300 10/)
expect(chef_run).to render_file('/var/opt/gitlab/redis/redis.conf')
.with_content(/^save 60 10000/)
end
end
 
Loading
Loading
@@ -24,7 +30,8 @@ describe 'gitlab::redis' do
redis: {
client_output_buffer_limit_normal: "5 5 5",
client_output_buffer_limit_slave: "512mb 128mb 120",
client_output_buffer_limit_pubsub: "64mb 16mb 120"
client_output_buffer_limit_pubsub: "64mb 16mb 120",
save: ["10 15000"]
}
)
end
Loading
Loading
@@ -36,6 +43,37 @@ describe 'gitlab::redis' do
.with_content(/client-output-buffer-limit slave 512mb 128mb 120/)
expect(chef_run).to render_file('/var/opt/gitlab/redis/redis.conf')
.with_content(/client-output-buffer-limit pubsub 64mb 16mb 120/)
expect(chef_run).to render_file('/var/opt/gitlab/redis/redis.conf')
.with_content(/^save 10 15000/)
end
end
context 'with snapshotting disabled' do
before do
stub_gitlab_rb(
redis: {
save: []
}
)
end
it 'creates redis config without save setting' do
expect(chef_run).to render_file('/var/opt/gitlab/redis/redis.conf')
expect(chef_run).not_to render_file('/var/opt/gitlab/redis/redis.conf')
.with_content(/^save/)
end
end
context 'with snapshotting cleared' do
before do
stub_gitlab_rb(
redis: {
save: [""]
}
)
end
it 'creates redis config without save setting' do
expect(chef_run).to render_file('/var/opt/gitlab/redis/redis.conf')
.with_content(/^save ""/)
end
end
end
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