Skip to content

chore: update upgrade scripts #533

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

Merged
merged 10 commits into from
Feb 13, 2023
Merged

Conversation

pcnc
Copy link
Member

@pcnc pcnc commented Feb 9, 2023

What kind of change does this PR introduce?

  • Initiate script now also disables extensions selectively per initial pg version
    • Generates script to re-enable extensions, if they exist on the resulting upgraded instance
  • Covers case in which latest libpq wasn't available for binaries used during the upgrade process
  • Improved logging
  • Dry-run mode

@pcnc pcnc requested a review from a team as a code owner February 9, 2023 09:15

echo "Re-enabling extensions"
if [ -f $POST_UPGRADE_EXTENSION_SCRIPT ]; then
run_sql -f $POST_UPGRADE_EXTENSION_SCRIPT
Copy link
Contributor

Choose a reason for hiding this comment

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

might be good to run these scripts through shellcheck -- it'd probably get mad about all the non-quoted variables

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point! Added a shellcheck workflow to help keep the admin_api_scripts folder in check


# Make latest libpq available to pg_upgrade
mkdir -p /usr/lib/postgresql/lib/aarch64
if [ ! -L /usr/lib/postgresql/lib/aarch64/libpq.so.5 ]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm do we block upgrades on the older x86 instances at some early stage?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not an explicit one - it's tied down to version eligibility since the last version supporting x86 was 12.5.
Will add additional checks in the admin cli and upcoming API support

@pcnc pcnc merged commit 697bf58 into develop Feb 13, 2023
@pcnc pcnc deleted the pcnc/older-instance-upgrade-scripts-compat branch February 13, 2023 15:31
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.

2 participants