Skip to content

Use more PostgreSQL attributes for Patroni parameters

What does this MR do?

This MR uses more of PostgreSQL attributes to set Patroni parameters. It uses the following order of precedence to determine the value of X where X is one of:

  • max_connections
  • max_locks_per_transaction
  • max_worker_processes
  • max_prepared_transactions
  • track_commit_timestamp
  • max_wal_senders
  • max_replication_slots
  • wal_keep_segments
  • wal_keep_size
  • checkpoint_timeout

Here is the order of precedence:

  1. patroni['postgresql'][X] that is set in gitlab.rb
  2. postgresql[X] that is set in gitlab.rb
  3. default value of X from postgresql cookbook, where X is not one of max_wal_senders, max_replication_slots, and checkpoint_timeout. These three keys have different default values in patroni cookbook and the value from postgresql cookbook may break the replication. As a general rule, if X has a default value in both patroni and postgresql and it is not specified in gitlab.rb (either with postgresql[...] or patroni['postgresql'][...], the default value from patroni cookbook takes precedence. This is the case for max_wal_senders, max_replication_slots, and checkpoint_timeout.
  4. default value of X from patroni cookbook.
  5. default value of X from postgresql cookbook.

Related issues

Fixes #5885 (closed)

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 dev.gitlab.org 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
Edited by Hossein Pursultani

Merge request reports

Loading