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

Run extension SQL script with default search_path = pg_catalog #3486

Open
wants to merge 32 commits into
base: BABEL_5_X_DEV
Choose a base branch
from

Conversation

SiddharthBITS
Copy link
Contributor

@SiddharthBITS SiddharthBITS commented Feb 12, 2025

Description

There have been a couple of scenarios(BABEL-5362 and BABEL-5595) where we saw upgrade failures which were missed as a part of our github upgrade workflow testing.

When investigated upon we saw a difference in search path in github and gitfarm during upgrade workflows. Also, when tested in OSS with the same search_path as in internal setup, we were able to reproduce the issue.

Key changes:

  • Setting runner's search_path as pg_catalog.
  • Enclosing ALTER EXTENSION queries inside transactions.
  • Updating TestSparsevecDatatype and TestVectorDatatype with order by to avoid flakiness.

Task: BABEL-5613
Signed-off-by: Siddharth Sengar sensid@amazon.com

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request,
I confirm that my contribution is under the terms of the Apache 2.0 and PostgreSQL licenses, and grant any person obtaining a copy of the contribution permission to relicense all or a portion of my contribution to the PostgreSQL License solely to contribute all or a portion of my contribution to the PostgreSQL open source project.

For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@SiddharthBITS SiddharthBITS changed the title [TEST] Testing ALTER ROLE runner SET search_path TO PG_CATALOG; on all tests [TEST] Testing ALTER USER runner WITH DEFAULT_SCHEMA = pg_catalog; Feb 12, 2025
@coveralls
Copy link
Collaborator

coveralls commented Feb 13, 2025

Pull Request Test Coverage Report for Build 13366766524

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.002%) to 75.017%

Totals Coverage Status
Change from base Build 13290724488: 0.002%
Covered Lines: 47131
Relevant Lines: 62827

💛 - Coveralls

@tanscorpio7
Copy link
Contributor

Some workflows are failing because your fork has stale head commit for BABEL_* branches

Copy link
Contributor

@Anikait143 Anikait143 left a comment

Choose a reason for hiding this comment

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

Please have proper PR title.

Comment on lines +119 to +120
# Testing default case without updated search path
# sudo ~/${{env.OLD_INSTALL_DIR}}/bin/psql -v ON_ERROR_STOP=1 -d postgres -U runner -c "ALTER ROLE runner SET search_path TO PG_CATALOG;"
Copy link
Contributor

Choose a reason for hiding this comment

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

Cool, this will ensure our upgrade script is tested both ways forcing objects to be schema qualified.

@SiddharthBITS SiddharthBITS changed the title [TEST] Testing ALTER USER runner WITH DEFAULT_SCHEMA = pg_catalog; [OSS-ONLY] Fixing difference in search_path in Github and Gitfarm Feb 17, 2025
@@ -60,9 +60,8 @@ runs:
ulimit -c unlimited
cd ~
~/${{ inputs.install_dir }}/bin/pg_ctl -c -D ~/${{ inputs.install_dir }}/data/ -l logfile restart
sudo ~/${{ inputs.install_dir }}/bin/psql -v ON_ERROR_STOP=1 -d babelfish_db -U runner -c "\dx"
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to remove this as it can be used to debug the extension versions prior to extension update

@SiddharthBITS SiddharthBITS changed the title [OSS-ONLY] Fixing difference in search_path in Github and Gitfarm [OSS-ONLY] Run extension SQL script with default search_path = pg_catalog Feb 17, 2025
@SiddharthBITS SiddharthBITS changed the title [OSS-ONLY] Run extension SQL script with default search_path = pg_catalog Run extension SQL script with default search_path = pg_catalog Feb 17, 2025
Copy link
Contributor

@Anikait143 Anikait143 left a comment

Choose a reason for hiding this comment

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

LGTM, please also cherry-pick this to 4_X, 3_X and 2_X branches

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.

4 participants