Skip to content

Add default replication factor configuration option to Praefect

Sami Hiltunen requested to merge smh-default-replication-factor into master

What does this MR do?

This MR adds support for a new Praefect configuration option for setting a virtual storage's default replication factor.

While adding the configuration option, I noticed that the structure of Praefect's configuration in omnibus does not match the actual structure of Praefect's config file. In order to add the configuration option in the correct location, the root of a virtual storage's config, this MR adds a workaround that moves configured storages under the nodes key and keeps only the known keys in the virtual storage's configuration in the root object. This allows for putting the option in the correct location and remains backwards compatible with existing configurations. We should later address the structure disparity properly by adding support for configuring the nodes in the correct location and adding a deprecation message.

Additionally, the tests were growing quite unwieldy. The output file was rendered multiple times and tested against with regular expressions. These regular expressions didn't cover the whole file, leaving some aspects untested. To aid with maintanability, this MR moves from regexes to asserting the whole config is a valid TOML file and matches exactly what is expected.

Related issues

gitaly#3362 (closed)
gitaly!3091 (merged)

Checklist

See Definition of done.

For anything in this list which will not be completed, please provide a reason in the MR discussion

Required

  • Merge Request Title, and Description are up to date, accurate, and descriptive
  • MR targeting the appropriate branch
  • MR has a green pipeline on GitLab.com
  • Pipeline is green on the dev.gitlab.org mirror for this branch if the change is touching anything besides documentation or internal cookbooks
  • trigger-package has a green pipeline running against latest commit

Expected (please provide an explanation if not completing)

  • Test plan indicating conditions for success has been posted and passes
  • Documentation created/updated
  • Tests added
  • Integration tests added to GitLab QA
  • Equivalent MR/issue for the GitLab Chart opened

Merge request reports

Loading