Skip to content
Snippets Groups Projects
Commit 9a1d8f3d authored by Sami Hiltunen's avatar Sami Hiltunen
Browse files

Add Praefect reconciliation config options

Makes it possible to configure Praefect's reconciliation through
gitlab.rb.
parent 11646a93
No related branches found
No related tags found
No related merge requests found
---
title: Add Praefect reconciliation config options
merge_request: 4571
author:
type: added
Loading
Loading
@@ -1994,6 +1994,8 @@ gitlab_rails['object_store']['objects']['terraform_state']['bucket'] = nil
# praefect['database_sslcert'] = '/path/to/client-cert'
# praefect['database_sslkey'] = '/path/to/client-key'
# praefect['database_sslrootcert'] = '/path/to/rootcert'
# praefect['reconciliation_scheduling_interval'] = '5m'
# praefect['reconciliation_histogram_buckets'] = '[0.001, 0.005, 0.025, 0.1, 0.5, 1.0, 10.0]'
 
################################################################################
# Storage check
Loading
Loading
Loading
Loading
@@ -27,6 +27,10 @@ socket_path = '<%= @socket_path %>'
prometheus_listen_addr = '<%= @prometheus_listen_addr %>'
<% end %>
 
[reconciliation]
<%= "scheduling_interval = '#{@reconciliation_scheduling_interval}'" if @reconciliation_scheduling_interval %>
<%= "histogram_buckets = #{@reconciliation_histogram_buckets}" if @reconciliation_histogram_buckets %>
[failover]
<% unless @failover_enabled.nil? %>
enabled = <%= @failover_enabled %>
Loading
Loading
Loading
Loading
@@ -46,6 +46,7 @@ RSpec.describe 'praefect' do
'prometheus_listen_addr' => 'localhost:9652',
'sentry' => {},
'database' => {},
'reconciliation' => {},
'failover' => { 'enabled' => true,
'election_strategy' => 'sql' }
}
Loading
Loading
@@ -110,6 +111,9 @@ RSpec.describe 'praefect' do
let(:database_sslcert) { '/path/to/client-cert' }
let(:database_sslkey) { '/path/to/client-key' }
let(:database_sslrootcert) { '/path/to/rootcert' }
let(:database_sslrootcert) { '/path/to/rootcert' }
let(:reconciliation_scheduling_interval) { '1m' }
let(:reconciliation_histogram_buckets) { '[1.0, 2.0]' }
 
before do
stub_gitlab_rb(praefect: {
Loading
Loading
@@ -139,10 +143,23 @@ RSpec.describe 'praefect' do
database_sslcert: database_sslcert,
database_sslkey: database_sslkey,
database_sslrootcert: database_sslrootcert,
reconciliation_scheduling_interval: reconciliation_scheduling_interval,
reconciliation_histogram_buckets: reconciliation_histogram_buckets
})
end
 
it 'renders the config.toml' do
expect(chef_run).to render_file(config_path).with_content { |content|
expect(Tomlrb.parse(content)).to include(
{
'reconciliation' => {
'scheduling_interval' => '1m',
'histogram_buckets' => [1.0, 2.0]
}
}
)
}
expect(chef_run).to render_file(config_path)
.with_content("listen_addr = '#{listen_addr}'")
expect(chef_run).to render_file(config_path)
Loading
Loading
@@ -163,7 +180,6 @@ RSpec.describe 'praefect' do
.with_content(%r{\[failover\]\s+enabled = true\s+election_strategy = 'local'})
expect(chef_run).to render_file(config_path)
.with_content(%r{\[prometheus\]\s+grpc_latency_buckets = #{Regexp.escape(prometheus_grpc_latency_buckets)}})
expect(chef_run).to render_file(config_path)
.with_content(%r{^\[auth\]\ntoken = '#{auth_token}'\ntransitioning = #{auth_transitioning}\n})
 
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