Skip to content

Conversation

sdudoladov
Copy link
Member

@sdudoladov sdudoladov commented Oct 14, 2020

Spilo doc:

PGVERSION: Specifies the version of postgreSQL to reference in the bin_dir variable (/usr/lib/postgresql/PGVERSION/bin) if postgresql.bin_dir wasn't set in SPILO_CONFIGURATION

Using PGVERSION is now preferred to setting postgresql.bin_dir in SPILO_CONFIGURATION

This changes works just fine with any recent Spilo. Anyway as a precaution, we provide the toggle pgversion_env_var
When it is "true", the environment contains only PGVERSION

postgres@acid-minimal-cluster-0:~$ echo $SPILO_CONFIGURATION
{"postgresql":{},"bootstrap":{"initdb":[{"auth-host":"md5"},{"auth-local":"trust"}],"users":{"zalandos":{"password":"","options":["CREATEDB","NOLOGIN"]}},"dcs":{}}}
postgres@acid-minimal-cluster-0:~$ echo $PGVERSION
12

Otherwise SPILO_CONFIGURATION contains the postgresql.bin_dir subsection and PGVERSION is unset. The latter behavior is not strictly necessary because in Spilo the bin_dir takes precedence over PGVERSION when both are set. I deliberately made this case more explicit on the operator side and decided not to set PGVERSION when bin_dir is provided.

Flipping pgversion_env_var costs a rolling upgrade because pod environment changes.

per request from @CyberDem0n

See Spilo PR 222 for details.
blocked by #1160
closes #554

@sdudoladov sdudoladov self-assigned this Oct 14, 2020
@sdudoladov sdudoladov changed the title introduce PGVERSION [WIP] introduce PGVERSION Oct 14, 2020
@Jan-M
Copy link
Member

Jan-M commented Nov 3, 2020

So this PR will also remove bin dir from spilo configuration?

@sdudoladov
Copy link
Member Author

So this PR will also remove bin dir from spilo configuration?

yes, it will.

@sdudoladov sdudoladov changed the title [WIP] introduce PGVERSION Introduce PGVERSION Nov 4, 2020
@Jan-M
Copy link
Member

Jan-M commented Nov 26, 2020

👍

1 similar comment
@sdudoladov
Copy link
Member Author

👍

@FxKu FxKu added this to the 1.6 milestone Nov 27, 2020
@sdudoladov sdudoladov merged commit dc9a5b1 into master Nov 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants