Commit faaa662c authored by Sami Hiltunen's avatar Sami Hiltunen

Set a flag to allow unsupported election strategy in Praefect

Praefect has deprecated other election strategies than 'per_repository'
in 13.12. The legacy strategies are scheduled to be removed in 14.0.
GitLab's tests are currently using one of them. Updating the tests to
support the new strategy is slightly involved as the new strategy
requires a database. To allow for Gitaly team to prevent the use of the
legacy election strategies from 14.0 onwards but to keep the GitLab tests
still passing before the setup can be reworked, we added a configuration
flag to explicitly allow these unsupported election strategies to be
configured still. This commit sets the flag for GitLab's test so they
keep working for now until we can set up a database connection in them.
parent 3bffcebf
...@@ -153,8 +153,14 @@ module Gitlab ...@@ -153,8 +153,14 @@ module Gitlab
second_storage_nodes = [{ storage: 'test_second_storage', address: "unix:#{gitaly_dir}/gitaly2.socket", primary: true, token: 'secret' }] second_storage_nodes = [{ storage: 'test_second_storage', address: "unix:#{gitaly_dir}/gitaly2.socket", primary: true, token: 'secret' }]
storages = [{ name: 'default', node: nodes }, { name: 'test_second_storage', node: second_storage_nodes }] storages = [{ name: 'default', node: nodes }, { name: 'test_second_storage', node: second_storage_nodes }]
failover = { enabled: false } failover = { enabled: false, election_strategy: 'local' }
config = { socket_path: "#{gitaly_dir}/praefect.socket", memory_queue_enabled: true, virtual_storage: storages, failover: failover } config = {
i_understand_my_election_strategy_is_unsupported_and_will_be_removed_without_warning: true,
socket_path: "#{gitaly_dir}/praefect.socket",
memory_queue_enabled: true,
virtual_storage: storages,
failover: failover
}
config[:token] = 'secret' if Rails.env.test? config[:token] = 'secret' if Rails.env.test?
TomlRB.dump(config) TomlRB.dump(config)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment