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:
- 
patroni['postgresql'][X]that is set ingitlab.rb
- 
postgresql[X]that is set ingitlab.rb
- default value of- Xfrom- postgresqlcookbook, where- Xis not one of- max_wal_senders,- max_replication_slots, and- checkpoint_timeout. These three keys have different default values in- patronicookbook and the value from- postgresqlcookbook may break the replication. As a general rule, if- Xhas a default value in both- patroniand- postgresqland it is not specified in- gitlab.rb(either with- postgresql[...]or- patroni['postgresql'][...], the default value from- patronicookbook takes precedence. This is the case for- max_wal_senders,- max_replication_slots, and- checkpoint_timeout.
- default value of Xfrompatronicookbook.
- default value of Xfrompostgresqlcookbook.
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-packagehas 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