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

Update DB format on install/upgrade if required #58

Closed
2 tasks done
phillxnet opened this issue Jan 20, 2024 · 3 comments
Closed
2 tasks done

Update DB format on install/upgrade if required #58

phillxnet opened this issue Jan 20, 2024 · 3 comments
Assignees

Comments

@phillxnet
Copy link
Member

phillxnet commented Jan 20, 2024

Older installs resulting from Rockstor-Leap15.3-generic.x86_64-4.1.0-0.install.iso Jan 14 2022 or earlier, that have also been zypper duped to at least a 15.4 base OS will now require a DB update prior to being compatible with the Django LTS 4.2 & psycopg3 that are used in current testing (5.0.6-0) and proposed next stable of 5.1.0-0.

Partner issue to rockstor-core:
"Establish Postgres database format upgrade": rockstor/rockstor-core#2780

  • Establish new dependency to make pg_upgrade for target Postgres (13) available.
  • Run via install/update scriptlets the shell script to be made available via the linked partner issue in rockstor-core.
@phillxnet
Copy link
Member Author

pg_upgrade

zypper in --no-recommends postgresql13-contrib
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following 2 NEW packages are going to be installed:
  postgresql13-contrib postgresql-contrib

2 new packages to install.
Overall download size: 785.2 KiB. Already cached: 0 B. After the operation, additional 3.1 MiB will be used.
Continue? [y/n/v/...? shows all options] (y):

This looks to also have an alternatives setting:

installer:~ # which pg_upgrade 
/usr/bin/pg_upgrade
installer:~ # ls -la /usr/bin/pg_upgrade
lrwxrwxrwx 1 root root 28 Nov 10 12:38 /usr/bin/pg_upgrade -> /etc/alternatives/pg_upgrade
installer:~ # ls -la /etc/alternatives/pg_upgrade
lrwxrwxrwx 1 root root 36 Jan 20 18:55 /etc/alternatives/pg_upgrade -> /usr/lib/postgresql13/bin/pg_upgrade

pg_upgrade alternative setting

installer:~ # alternatives --display postgresql | grep pg_upgrade 
  slave pg_upgrade is /usr/bin/pg_upgrade
  slave pg_upgrade: /usr/lib/postgresql13/bin/pg_upgrade

Confirming that our existing Postgres alternatives ensures our default pg_upgrade is in line with out target Posgtres binary version.
I.e. from:
we have:

"Always run the pg_upgrade binary of the new server, not the old one."

This is assumed to be resolved via our Postgres alternatives setting, already in play.

@phillxnet phillxnet self-assigned this Jan 21, 2024
@phillxnet
Copy link
Member Author

phillxnet commented Jan 21, 2024

Our linked partner-issue now has an associated draft PR:
"Establish Postgres database format upgrade ...": rockstor/rockstor-core#2781
proposing a DB format upgrade bash script.

We can now proceed to introduce the additional dependencies required by this script and test its invocation from the relevant scriptlets to enable auto DB format upgrade if required.

phillxnet added a commit to phillxnet/rockstor-rpmbuild that referenced this issue Jan 22, 2024
Adds postgresql13-contrib as a new Requires dependency.
Enable root execution: ./src/rockstor/scripts/db_upgrade.sh
Run this same script in %posttrans.
phillxnet added a commit that referenced this issue Jan 25, 2024
…upgrade-if-required

Update DB format on install/upgrade if required #58
@phillxnet
Copy link
Member Author

Closing as:
Fixed by #59

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

No branches or pull requests

1 participant