-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pgpool not showing Replication State #1845
Pgpool not showing Replication State #1845
Conversation
to-bar
commented
Nov 12, 2020
- Correct backend_application_name in pgpool.conf
- Group tasks and change order
- Remove unneeded tasks
- Group tasks using blocks
- Improve code
- Create symlink /etc/repmgr.conf
- Shorten repmgr commands due to symlink to config file
- Ensure postgresql instance is stopped
- Update changelog
- Update documentation
/azp run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code in this PR looks ok to me, but I'm not impressed after reading whole that role for the first time. :( I guess my suggestions are more for refactoring the role which is out of the scope of this PR. 🤗
My recommendations for the future would be:
- Make important settings (like archive_mode that we care about) mapped one-to-one with the target config files, which would elliminate having them seeded with random values coming from the package creator in case of issues with merging.
- Add schema validation! So an user has any kind of feedback if after any upgrade current config is not disabling/enabling some important settings.
- Make all configs dict-based instead of being list-based (that will enable merging) or we should add proper merging of list-based dicts with
name:
as a key. - Get rid of lineinfile/replace statements, instead use full config templates and include statements.
- Probably good idea would be keeping Postgres' data dir in a custom place (identical on all Linux distros), it would be handy with upgrades I think.
- Relying on ordering of postgresql group is naive and simply incorrect if you take into account autoscaling groups in AWS. Is there any upgrade procedure to switch from 1 master to 1 master + 1 slave and back - is it supported?
- Please don't use the notorious Software Collections ever again anywhere in the code! 🤗
mode: u=rw,g=,o= | ||
|
||
- name: Add replication user to pg_hba.conf | ||
lineinfile: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really like that we're using lineinfile, for me it's ugly. I think we should have full control over all configuration options. I guess changing this here now is not in scope of this PR.. I just wanted to express my dissatisfaction. 👍😇
- is_node_already_registered.stdout == "" | ||
# For repmgr installed from Ubuntu package additional configuration is required before repmgrd is started as daemon | ||
- name: Set repmgr.conf file in /etc/default/repmgrd | ||
replace: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same argument as in I don't really like that we're using lineinfile, for me it's ugly..
🤗
...rc/epicli/data/common/ansible/playbooks/roles/postgresql/tasks/replication-repmgr-Debian.yml
Show resolved
Hide resolved
* Correct backend_application_name in pgpool.conf * Group tasks and change order * Remove unneeded tasks * Group tasks using blocks * Improve code * Create symlink /etc/repmgr.conf * Shorten repmgr commands due to symlink to config file * Ensure postgresql instance is stopped * Update changelog * Update documentation
* Correct backend_application_name in pgpool.conf * Group tasks and change order * Remove unneeded tasks * Group tasks using blocks * Improve code * Create symlink /etc/repmgr.conf * Shorten repmgr commands due to symlink to config file * Ensure postgresql instance is stopped * Update changelog * Update documentation