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

Upgrade to PG17 in Github actions #2114

Merged
merged 29 commits into from
Dec 27, 2024
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
3f2b3e4
upgraded to pg17 in misc-migtests.yml
priyanshi-yb Dec 24, 2024
9ac8127
fix expected files of assessment report and omnibus
priyanshi-yb Dec 24, 2024
489371d
upgraded in pg-migtests.yml
priyanshi-yb Dec 24, 2024
7a67a61
fixed failed.sql view stmts of omnibus
priyanshi-yb Dec 24, 2024
5d92ce9
fixed failed.sql of omnibus for a VIEW and skip execution of SET tran…
priyanshi-yb Dec 24, 2024
3cea491
fix shouldSkipDDL
priyanshi-yb Dec 24, 2024
2346459
fix expected files adventureworks
priyanshi-yb Dec 24, 2024
3ce3c4c
Merge branch 'main' into priyanshi/upgrade-17
priyanshi-yb Dec 24, 2024
91dfef1
fix install postgis to install respected pg_version's postgis
priyanshi-yb Dec 24, 2024
a1fa6d0
fix pg tests for not running sample schema ones for pg13 and setting …
priyanshi-yb Dec 24, 2024
7962084
fix pg-migtests.yml;
priyanshi-yb Dec 24, 2024
d270ca1
separate workflows for PG 13 and 17
priyanshi-yb Dec 24, 2024
49df585
Merge branch 'main' into priyanshi/upgrade-17
priyanshi-yb Dec 24, 2024
ab66c62
fix after merge main
priyanshi-yb Dec 24, 2024
79937cc
fix-job name
priyanshi-yb Dec 24, 2024
7e212c6
fix-job name
priyanshi-yb Dec 24, 2024
9a3bda4
debug
priyanshi-yb Dec 26, 2024
13d3aa6
Merge branch 'main' into priyanshi/upgrade-17
priyanshi-yb Dec 26, 2024
8e2e547
fixed aggregate test case
priyanshi-yb Dec 26, 2024
e142457
change admin pass
priyanshi-yb Dec 26, 2024
95872a5
fixed pass in gh
priyanshi-yb Dec 26, 2024
3d47707
fix admin pass in ff_env
priyanshi-yb Dec 26, 2024
d13c6f5
revert debug
priyanshi-yb Dec 26, 2024
d0fc2b1
review comment
priyanshi-yb Dec 27, 2024
d0c640d
Merge branch 'main' into priyanshi/upgrade-17
priyanshi-yb Dec 27, 2024
7c991ca
todo
priyanshi-yb Dec 27, 2024
0f38c5c
commit file
priyanshi-yb Dec 27, 2024
b4c4cf2
nit
priyanshi-yb Dec 27, 2024
fe6ae57
Merge branch 'main' into priyanshi/upgrade-17
priyanshi-yb Dec 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .github/workflows/misc-migtests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:

services:
postgres:
image: postgres:15
image: postgres:17
env:
POSTGRES_PASSWORD: secret
POSTGRES_PASSWORD: postgres
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
Expand Down Expand Up @@ -59,13 +59,14 @@ jobs:
run: |
cd installer_scripts
yes | ./install-yb-voyager --install-from-local-source --only-pg-support
echo "/usr/lib/postgresql/16/bin" >> "$GITHUB_PATH"
sudo apt-get -y install postgresql-17
echo "/usr/lib/postgresql/17/bin" >> "$GITHUB_PATH"
env:
ON_INSTALLER_ERROR_OUTPUT_LOG: Y

- name: Test PostgreSQL Connection
run: |
psql "postgresql://postgres:secret@127.0.0.1:5432/postgres" -c "SELECT version();"
psql "postgresql://postgres:postgres@127.0.0.1:5432/postgres" -c "SELECT version();"

- name: Create PostgreSQL user
run: |
Expand Down
219 changes: 219 additions & 0 deletions .github/workflows/pg-13-migtests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,219 @@
name: "PG 13: Migration Tests"

on:
push:
branches: ['main', '*.*-dev', '*.*.*-dev']
pull_request:
branches: ['main']

jobs:
run-pg-13-migration-tests:
strategy:
matrix:
version: [2024.2.0.0-b145, 2.20.8.0-b53, 2024.1.3.1-b8, 2.23.1.0-b220]
BETA_FAST_DATA_EXPORT: [0, 1]
test_group:
- offline
- live_basic
- live_advanced

env:
BETA_FAST_DATA_EXPORT: ${{ matrix.BETA_FAST_DATA_EXPORT }}
runs-on: ubuntu-22.04
services:
postgres:
image: postgres:13
env:
POSTGRES_PASSWORD: postgres
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432

steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
# https://github.com/actions/setup-java
with:
distribution: "temurin"
java-version: "17"
check-latest: true

- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-

- name: "Enable postgres with wal_level as logical and install postgis"
run: |
docker exec ${{ job.services.postgres.id }} sh -c "echo 'wal_level=logical' >> /var/lib/postgresql/data/postgresql.conf"
docker exec ${{ job.services.postgres.id }} sh -c "apt-get update && apt-get install -y postgresql-13-postgis postgresql-13-postgis-3"
docker restart ${{ job.services.postgres.id }}
sleep 10

- name: Install python3 and psycopg2
run: |
sudo apt install -y python3
sudo apt install -y libpq-dev
sudo apt install python3-psycopg2

- name: Run installer script to setup voyager
run: |
cd installer_scripts
yes | ./install-yb-voyager --install-from-local-source --only-pg-support
sudo rm /usr/bin/pg_dump
sudo ln -s /usr/lib/postgresql/16/bin/pg_dump /usr/bin/pg_dump
sudo rm /usr/bin/pg_restore
sudo ln -s /usr/lib/postgresql/16/bin/pg_restore /usr/bin/pg_restore
pg_dump --version
env:
ON_INSTALLER_ERROR_OUTPUT_LOG: Y

- name: Test PostgreSQL Connection
run: |
psql "postgresql://postgres:[email protected]:5432/postgres" -c "SELECT version();"

- name: Create PostgreSQL user
run: |
./migtests/scripts/postgresql/create_pg_user

- name: Start YugabyteDB cluster
run: |
docker run -d --name yugabytedb \
-p7000:7000 -p9000:9000 -p15433:15433 -p5433:5433 -p9042:9042 \
yugabytedb/yugabyte:${{ matrix.version }} \
bin/yugabyted start --background=false --ui=false
sleep 20

- name: Test YugabyteDB connection
run: |
psql "postgresql://yugabyte:@127.0.0.1:5433/yugabyte" -c "SELECT version();"

- name: Create YugabyteDB user
run: |
./migtests/scripts/yugabytedb/create_yb_user

- name: Enable yb-tserver-n1 and yb-master-n1 name resolution
run: |
echo "127.0.0.1 yb-tserver-n1" | sudo tee -a /etc/hosts
echo "127.0.0.1 yb-master-n1" | sudo tee -a /etc/hosts
psql "postgresql://yugabyte@yb-tserver-n1:5433/yugabyte" -c "SELECT version();"

- name: "TEST: pg-table-list-flags-test (table-list and exclude-table-list)"
if: ${{ !cancelled() && matrix.test_group == 'offline' }}
run: migtests/scripts/run-test.sh pg/table-list-flags-tests

- name: "TEST: pg-table-list-file-path-test (table-list-file-path and exclude-table-list-file-path)"
if: ${{ !cancelled() && matrix.test_group == 'offline' }}
run: migtests/scripts/run-test.sh pg/table-list-flags-tests env-file-path-flags.sh

- name: "TEST: pg-case-sensitivity-single-table"
if: ${{ !cancelled() && matrix.test_group == 'offline' }}
run: migtests/scripts/run-test-export-data.sh pg/case-sensitivity-single-table

- name: "TEST: pg-dvdrental"
if: ${{ !cancelled() && matrix.test_group == 'offline' }}
run: migtests/scripts/run-test.sh pg/dvdrental

- name: "TEST: pg-datatypes"
if: ${{ !cancelled() && matrix.test_group == 'offline' }}
run: migtests/scripts/run-test.sh pg/datatypes

- name: "TEST: pg-constraints"
if: ${{ !cancelled() && matrix.test_group == 'offline' }}
run: migtests/scripts/run-test.sh pg/constraints

- name: "TEST: pg-sequences"
if: ${{ !cancelled() && matrix.test_group == 'offline' }}
run: migtests/scripts/run-test.sh pg/sequences

- name: "TEST: pg-indexes"
if: ${{ !cancelled() && matrix.test_group == 'offline' }}
run: migtests/scripts/run-test.sh pg/indexes

- name: "TEST: pg-partitions"
if: ${{ !cancelled() && matrix.test_group == 'offline' }}
run: migtests/scripts/run-test.sh pg/partitions

- name: "TEST: pg-partitions with (table-list)"
if: ${{ !cancelled() && matrix.test_group == 'offline' }}
run: EXPORT_TABLE_LIST='customers,sales,emp,p2.boston,p2.london,p2.sydney,range_columns_partition_test,sales_region,test_partitions_sequences' migtests/scripts/run-test.sh pg/partitions

# Broken for v2.15 and v2.16: https://github.com/yugabyte/yugabyte-db/issues/14529
# Fixed in 2.17.1.0-b368
- name: "TEST: pg-partitions-with-indexes"
if: ${{ !cancelled() && matrix.test_group == 'offline' }}
run: migtests/scripts/run-test.sh pg/partitions-with-indexes

- name: "TEST: pg-views-and-rules"
if: ${{ !cancelled() && matrix.test_group == 'offline' }}
run: migtests/scripts/run-test.sh pg/views-and-rules

- name: "TEST: pg-misc-objects-1 (Types, case-sensitive-table-name, Domain)"
if: ${{ !cancelled() && matrix.test_group == 'offline' }}
run: migtests/scripts/run-test.sh pg/misc-objects-1

- name: "TEST: pg-misc-objects-2 (Aggregates, Procedures, triggers, functions, extensions, inline comments)"
if: ${{ !cancelled() && matrix.test_group == 'offline' }}
run: migtests/scripts/run-test.sh pg/misc-objects-2

- name: "TEST: pg-dependent-ddls"
if: ${{ !cancelled() && matrix.test_group == 'offline' }}
run: migtests/scripts/run-test.sh pg/dependent-ddls

- name: "TEST: pg-multiple-schemas"
if: ${{ !cancelled() && matrix.test_group == 'offline' }}
run: migtests/scripts/run-test.sh pg/multiple-schemas

- name: "TEST: pg-codependent-schemas"
if: ${{ !cancelled() && matrix.test_group == 'offline' }}
run: migtests/scripts/run-test.sh pg/codependent-schemas

- name: "TEST: pg-sample-schema-emp"
if: ${{ !cancelled() && matrix.test_group == 'offline' }}
run: migtests/scripts/run-test.sh pg/sample-employee

- name: "TEST: pg-hasura-ecommerce"
if: ${{ !cancelled() && matrix.test_group == 'offline' }}
run: migtests/scripts/run-test.sh pg/hasura-ecommerce

- name: "TEST: pg-case-sensitivity-reserved-words-offline"
if: ${{ !cancelled() && matrix.test_group == 'offline' }}
run: migtests/scripts/run-test.sh pg/case-sensitivity-reserved-words

- name: "TEST: pg-basic-non-public-live-migration-test"
if: ${{ !cancelled() && matrix.test_group == 'live_basic' }}
run: migtests/scripts/live-migration-run-test.sh pg/basic-non-public-live-test

- name: "TEST: pg-basic-public-fall-forward-test"
if: ${{ !cancelled() && matrix.test_group == 'live_basic' }}
run: migtests/scripts/live-migration-fallf-run-test.sh pg/basic-public-live-test

# - name: "TEST: pg-basic-non-public-fall-back-test"
# run: migtests/scripts/live-migration-fallb-run-test.sh pg/basic-non-public-live-test

- name: "TEST: pg-datatypes-fall-back-test"
if: ${{ !cancelled() && matrix.test_group == 'live_basic' }}
run: migtests/scripts/live-migration-fallb-run-test.sh pg/datatypes

# case sensitive table names are not yet supported in live migration, to restricting test only to a few tables.
- name: "TEST: pg-live-migration-multiple-schemas"
if: ${{ !cancelled() && matrix.test_group == 'live_advanced' }}
run: EXPORT_TABLE_LIST="ext_test,tt,audit,recipients,session_log,schema2.ext_test,schema2.tt,schema2.audit,schema2.recipients,schema2.session_log" migtests/scripts/live-migration-run-test.sh pg/multiple-schemas

- name: "TEST: pg-unique-key-conflicts-test"
if: ${{ !cancelled() && matrix.test_group == 'live_advanced' }}
run: migtests/scripts/live-migration-fallf-run-test.sh pg/unique-key-conflicts-test

- name: "TEST: pg-live-migration-partitions-fall-forward"
if: ${{ !cancelled() && matrix.test_group == 'live_advanced' }}
run: migtests/scripts/live-migration-fallf-run-test.sh pg/partitions

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "PG 13: Migration Tests"
name: "PG 17: Migration Tests"

on:
push:
Expand All @@ -7,7 +7,7 @@ on:
branches: ['main']

jobs:
run-pg-migration-tests:
run-pg-17-migration-tests:
strategy:
matrix:
version: [2024.2.0.0-b145, 2.20.8.0-b53, 2024.1.3.1-b8, 2.23.1.0-b220]
Expand All @@ -22,9 +22,9 @@ jobs:
runs-on: ubuntu-22.04
services:
postgres:
image: postgres:13
image: postgres:17
env:
POSTGRES_PASSWORD: secret
POSTGRES_PASSWORD: postgres
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
- name: "Enable postgres with wal_level as logical and install postgis"
run: |
docker exec ${{ job.services.postgres.id }} sh -c "echo 'wal_level=logical' >> /var/lib/postgresql/data/postgresql.conf"
docker exec ${{ job.services.postgres.id }} sh -c "apt-get update && apt-get install -y postgresql-13-postgis postgresql-13-postgis-3"
docker exec ${{ job.services.postgres.id }} sh -c "apt-get update && apt-get install -y postgresql-17-postgis postgresql-17-postgis-3"
docker restart ${{ job.services.postgres.id }}
sleep 10

Expand All @@ -69,17 +69,18 @@ jobs:
run: |
cd installer_scripts
yes | ./install-yb-voyager --install-from-local-source --only-pg-support
sudo apt-get -y install postgresql-17
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we start shipping PG 17 via installer script now?
Because
If we are gonna detect till PG17, then installing older version during setup is of no use.
It will be a manual step for the user unnecessarily.

Lets discuss this in the standup tomorrow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes that is already in plan. I believe there is already ticket for that https://yugabyte.atlassian.net/browse/DB-14593

Copy link
Collaborator

Choose a reason for hiding this comment

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

cool, just add a TODO here saying that we need to remove this once installer script picks up 17

sudo rm /usr/bin/pg_dump
sudo ln -s /usr/lib/postgresql/16/bin/pg_dump /usr/bin/pg_dump
sudo ln -s /usr/lib/postgresql/17/bin/pg_dump /usr/bin/pg_dump
sudo rm /usr/bin/pg_restore
sudo ln -s /usr/lib/postgresql/16/bin/pg_restore /usr/bin/pg_restore
sudo ln -s /usr/lib/postgresql/17/bin/pg_restore /usr/bin/pg_restore
pg_dump --version
env:
ON_INSTALLER_ERROR_OUTPUT_LOG: Y

- name: Test PostgreSQL Connection
run: |
psql "postgresql://postgres:secret@127.0.0.1:5432/postgres" -c "SELECT version();"
psql "postgresql://postgres:postgres@127.0.0.1:5432/postgres" -c "SELECT version();"

- name: Create PostgreSQL user
run: |
Expand Down Expand Up @@ -108,27 +109,27 @@ jobs:
psql "postgresql://yugabyte@yb-tserver-n1:5433/yugabyte" -c "SELECT version();"

- name: "TEST: PG sample schemas (sakila)"
if: ${{ !cancelled() && matrix.test_group == 'offline' }}
if: ${{ !cancelled() && matrix.test_group == 'offline'}}
Copy link
Collaborator

@sanyamsinghal sanyamsinghal Dec 27, 2024

Choose a reason for hiding this comment

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

nit: be consistent in formatting here(wrt the spaces before/after braces used):
${{ !cancelled() && matrix.test_group == 'offline' }}
or
${{!cancelled() && matrix.test_group == 'offline'}}

run: migtests/scripts/run-schema-migration.sh pg/sakila

- name: "TEST: PG sample schemas (osm)"
if: ${{ !cancelled() && matrix.test_group == 'offline' }}
if: ${{ !cancelled() && matrix.test_group == 'offline'}}
run: migtests/scripts/run-schema-migration.sh pg/osm

- name: "TEST: PG sample schemas (adventureworks)"
if: ${{ !cancelled() && matrix.test_group == 'offline' }}
if: ${{ !cancelled() && matrix.test_group == 'offline'}}
run: migtests/scripts/run-schema-migration.sh pg/adventureworks

- name: "TEST: PG sample schemas (sample-is)"
if: ${{ !cancelled() && matrix.test_group == 'offline' }}
if: ${{ !cancelled() && matrix.test_group == 'offline'}}
run: migtests/scripts/run-schema-migration.sh pg/sample-is

- name: "TEST: PG sample schemas (pgtbrus)"
if: ${{ !cancelled() && matrix.test_group == 'offline' }}
run: migtests/scripts/run-schema-migration.sh pg/pgtbrus\
if: ${{ !cancelled() && matrix.test_group == 'offline'}}
run: migtests/scripts/run-schema-migration.sh pg/pgtbrus

- name: "TEST: PG sample schemas (stackexchange)"
if: ${{ !cancelled() && matrix.test_group == 'offline' }}
if: ${{ !cancelled() && matrix.test_group == 'offline'}}
run: migtests/scripts/run-schema-migration.sh pg/stackexchange

- name: "TEST: pg-table-list-flags-test (table-list and exclude-table-list)"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pg-9-migtests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches: ['main']

jobs:
run-pg-migration-tests:
run-pg-9-migration-tests:
strategy:
matrix:
version: [2024.2.0.0-b145]
Expand All @@ -19,7 +19,7 @@ jobs:
postgres:
image: postgres:9
env:
POSTGRES_PASSWORD: secret
POSTGRES_PASSWORD: postgres
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:

- name: Test PostgreSQL Connection
run: |
psql "postgresql://postgres:secret@127.0.0.1:5432/postgres" -c "SELECT version();"
psql "postgresql://postgres:postgres@127.0.0.1:5432/postgres" -c "SELECT version();"

- name: Create PostgreSQL user
run: |
Expand Down
2 changes: 1 addition & 1 deletion migtests/scripts/postgresql/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ export SOURCE_DB_PORT=${SOURCE_DB_PORT:-5432}
export SOURCE_DB_USER=${SOURCE_DB_USER:-"ybvoyager"}
export SOURCE_DB_PASSWORD=${SOURCE_DB_PASSWORD:-'Test@123#$%^&*()!'}
export SOURCE_DB_ADMIN_USER=${SOURCE_DB_ADMIN_USER:-"postgres"}
export SOURCE_DB_ADMIN_PASSWORD=${SOURCE_DB_ADMIN_PASSWORD:-"secret"}
export SOURCE_DB_ADMIN_PASSWORD=${SOURCE_DB_ADMIN_PASSWORD:-"postgres"}
2 changes: 1 addition & 1 deletion migtests/scripts/postgresql/ff_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ export SOURCE_REPLICA_DB_NAME=${SOURCE_REPLICA_DB_NAME:-"ff_db"}
export SOURCE_REPLICA_DB_HOST=${SOURCE_REPLICA_DB_HOST:-"127.0.0.1"}
export SOURCE_REPLICA_DB_PORT=${SOURCE_REPLICA_DB_PORT:-"5432"}
export SOURCE_REPLICA_DB_USER=${SOURCE_REPLICA_DB_USER:-"postgres"}
export SOURCE_REPLICA_DB_PASSWORD=${SOURCE_REPLICA_DB_PASSWORD:-"secret"}
export SOURCE_REPLICA_DB_PASSWORD=${SOURCE_REPLICA_DB_PASSWORD:-"postgres"}
Loading