Skip to content
This repository has been archived by the owner on Jan 23, 2019. It is now read-only.

prevent cluster init / create_main_cluster? #140

Open
rmoriz opened this issue Feb 12, 2015 · 3 comments
Open

prevent cluster init / create_main_cluster? #140

rmoriz opened this issue Feb 12, 2015 · 3 comments

Comments

@rmoriz
Copy link
Contributor

rmoriz commented Feb 12, 2015

When installing the postgresql server package, a new cluster will automatically be created (Debian 7 + postgresql.org packages). This prevents this cookbook from executing the resouces specified in postgresql::data_directory.

This also makes https://github.com/phlipper/chef-postgresql/blob/master/attributes/default.rb#L38 useless, e.g. you can't customize the process like enabling the checksum feature which is only configurable at cluster initialization time.

I'm not sure how to solve this, maybe setting create_main_cluster=false in /etc/postgresql-common/createcluster.conf will prevent the package script to init a default cluster. I've seen this in the "official" Dockerfile and also in this chef recipe

Skipping this would allow the already existing recipe postgresql::data_directory to do the job and also respect the custom attributes.

What do you think?

@rmoriz
Copy link
Contributor Author

rmoriz commented Feb 13, 2015

This brings up another issue on Debian:

The default recipe includes the debian-backports AND the pgdg apt repo. However it installs the debian-backport's postgresql-common first, which does not include the createcluster.conf-stuff mentioned above.

But the following postgresql::server installs the pgdg packages and upgrades postgresql-common to the pgpg package with the results in the problem mentioned above.

  1. Is there a reason to require debian-backports at all?
  2. If yes: why install postgresql-common and libpq5from debian-backports? see https://github.com/phlipper/chef-postgresql/blob/master/recipes/debian_backports.rb#L20

@phlipper
Copy link
Owner

@rmoriz thanks for the information. I don't have an integration test around cluster management at the moment so I have not personally run in to the first case yet, but I am definitely open to a fix for this behavior.

Regarding the debian_backports, that was added about 2 years ago to support some issues I was running in to with Debian 6. I have since dropped support for Debian 6 so that may no longer be necessary. I am open to removing this as well.

My personal focus has shifted more towards supporting Ubuntu lately as that is what most of my clients are running, but am happy to keep Debian 7+ as a first class citizen. Would you be willing to submit a some PRs to address these issues?

@rmoriz
Copy link
Contributor Author

rmoriz commented Feb 13, 2015

  • debian backports

    Should be easy solvable by just removing the debian-specific code. Will check and submit PR.

  • pgdg's createcluster.conf

    I guess this affects Ubuntu, too. Many options can be changed later so people probably found a work-around. However in my case the "data checksum" option coming with pg 9.3+ is only settable on cluster init-time and there is no later migration possible. https://wiki.postgresql.org/wiki/What's_new_in_PostgreSQL_9.3#Data_Checksums

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants