Skip to content

Conversation

za-arthur
Copy link
Contributor

What kind of change does this PR introduce?

  • upgrade pg_repack from 1.5.0 to 1.5.2.

Additional context

New version will allow to run pg_repack by a non-superuser. Conversation on slack:
https://supabase.slack.com/archives/C02FHG9QQAF/p1730124043199329

PR on pg_repack repo:
reorg/pg_repack#431

1.5.2 doesn't have release or tag yet, therefore instead of the tag commit id is used (85b64c6d4f599b2988343c4e7121acab505c9006).

Action Items

  • New extension releases were Checked for any breaking changes
  • Extensions compatibility Checked
  • Backup and Restore Checked
    • Proceed to backup testing while extensions are enabled
      • After every restore, re-run the tests specified at point 3.1

Extensions compatibility testing

  1. Enable every extension
    1. Check Postgres’ log output for any error messages while doing so
      1. This might unearth incompatibilities due to unsupported internal functions, missing libraries, or missing permissions
  2. Disable every extension
    1. Check Postgres’ log output for any cleanup-related error messages
  3. Re-enable each extension
    1. Run basic tests against the features they offer, e.g.:
      1. pg_net - execute HTTP requests
      2. pg_graphql - execute queries and mutations
      3. …to be filled in

Backup Testing

Follow the testing steps steps for all the following cases:

  • Pause on new Postgres version, restore on new Postgres version
  • Pause on older Postgres version, restore on new Postgres version
  • Run a single-file backup backup, restore the backup

Testing steps

  1. Generate dummy data
    • the ‘Countries’ or ‘Slack clone’ SQL editor snippets are decent datasets to work with, albeit limited
  2. Save a db stats snapshot file
    • Do this by running supa db-stats gather -p <project_ref>
  3. Backup the database, through pausing the project, or otherwise
  4. Restore the backup, through unpausing the project or cli
  5. Check the data has been recovered successfully
    1. Visual checks/navigating through the tables works
    2. Run supa db-stats verify against the project and the previously saved file

@za-arthur za-arthur requested a review from a team as a code owner November 7, 2024 15:23
New version allows to run pg_repack by a non-superuser.
PR on pg_repack repo:
reorg/pg_repack#431
@za-arthur za-arthur force-pushed the pg_repack_non_superuser branch from 519f48e to 1ec6986 Compare November 7, 2024 15:28
Copy link

repo: https://github.com/reorg/pg_repack.git
dest: /tmp/pg_repack
version: "ver_{{ pg_repack_release }}"
version: "{{ pg_repack_commit }}"
Copy link
Member

Choose a reason for hiding this comment

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

Q: Is this ansible file still used for postgres extensions? I thought we only do the Nix change nowadays

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review. Indeed, I wasn't sure if it was necessary. I reverted that change. I also bumped postgres release, it seems it is necessary to do on bumping an extension version.

@steve-chavez
Copy link
Member

steve-chavez commented Nov 7, 2024

Would it be possible to add a test for ensuring this works?

There are some example tests on https://github.com/supabase/postgres/tree/develop/nix/tests/sql

Oh, I see there's already a test upstream. Nevermind.

Copy link
Member

@steve-chavez steve-chavez left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@za-arthur za-arthur merged commit f5cbb07 into develop Nov 7, 2024
12 checks passed
@za-arthur za-arthur deleted the pg_repack_non_superuser branch November 7, 2024 16:53
damonrand pushed a commit to cepro/postgres that referenced this pull request Jun 15, 2025
New version allows to run pg_repack by a non-superuser.
PR on pg_repack repo:
reorg/pg_repack#431
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.

3 participants