Skip to content
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

Merged

Conversation

to-bar
Copy link
Contributor

@to-bar 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

@to-bar to-bar self-assigned this Nov 12, 2020
@to-bar
Copy link
Contributor Author

to-bar commented Nov 12, 2020

/azp run

Copy link
Contributor

@rafzei rafzei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@sk4zuzu sk4zuzu left a 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:

  1. 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.
  2. Add schema validation! So an user has any kind of feedback if after any upgrade current config is not disabling/enabling some important settings.
  3. 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.
  4. Get rid of lineinfile/replace statements, instead use full config templates and include statements.
  5. 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.
  6. 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?
  7. 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:
Copy link
Contributor

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:
Copy link
Contributor

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.. 🤗

@to-bar to-bar merged commit 77c11d7 into hitachienergy:develop Nov 17, 2020
@to-bar to-bar deleted the fix/postgres-rhel-show-replica-state branch November 17, 2020 08:15
rafzei pushed a commit to rafzei/epiphany that referenced this pull request Nov 26, 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
toszo pushed a commit to toszo/epiphany that referenced this pull request Dec 5, 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants