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_connectionsmax_locks_per_transactionmax_worker_processesmax_prepared_transactionstrack_commit_timestampmax_wal_sendersmax_replication_slotswal_keep_segmentswal_keep_sizecheckpoint_timeout
Here is the order of precedence:
-
patroni['postgresql'][X]that is set ingitlab.rb -
postgresql[X]that is set ingitlab.rb default value ofXfrompostgresqlcookbook, whereXis not one ofmax_wal_senders,max_replication_slots, andcheckpoint_timeout. These three keys have different default values inpatronicookbook and the value frompostgresqlcookbook may break the replication. As a general rule, ifXhas a default value in bothpatroniandpostgresqland it is not specified ingitlab.rb(either withpostgresql[...]orpatroni['postgresql'][...], the default value frompatronicookbook takes precedence. This is the case formax_wal_senders,max_replication_slots, andcheckpoint_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