Citus upgrade tests (#8237)

Expand the citus upgrade tests matrix:
PG15: v11.1.0 v11.3.0 v12.1.10
PG16: v12.1.10

See https://github.com/citusdata/the-process/pull/174
pull/8340/head
eaydingol 2025-10-15 15:28:44 +03:00 committed by eaydingol
parent 1596459b96
commit 584fcaff4c
5 changed files with 13 additions and 50 deletions

View File

@ -358,14 +358,20 @@ jobs:
flags: ${{ env.old_pg_major }}_${{ env.new_pg_major }}_upgrade flags: ${{ env.old_pg_major }}_${{ env.new_pg_major }}_upgrade
codecov_token: ${{ secrets.CODECOV_TOKEN }} codecov_token: ${{ secrets.CODECOV_TOKEN }}
test-citus-upgrade: test-citus-upgrade:
name: PG${{ fromJson(needs.params.outputs.pg15_version).major }} - check-citus-upgrade name: PG${{ fromJson(matrix.pg_version).major }} - check-citus-upgrade
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: container:
image: "${{ needs.params.outputs.citusupgrade_image_name }}:${{ fromJson(needs.params.outputs.pg15_version).full }}${{ needs.params.outputs.image_suffix }}" image: "${{ needs.params.outputs.citusupgrade_image_name }}:${{ fromJson(matrix.pg_version).full }}${{ needs.params.outputs.image_suffix }}"
options: --user root options: --user root
needs: needs:
- params - params
- build - build
strategy:
fail-fast: false
matrix:
pg_version:
- ${{ needs.params.outputs.pg15_version }}
- ${{ needs.params.outputs.pg16_version }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: "./.github/actions/setup_extension" - uses: "./.github/actions/setup_extension"
@ -374,7 +380,7 @@ jobs:
- name: Install and test citus upgrade - name: Install and test citus upgrade
run: |- run: |-
# run make check-citus-upgrade for all citus versions # run make check-citus-upgrade for all citus versions
# the image has ${CITUS_VERSIONS} set with all verions it contains the binaries of # the image has ${CITUS_VERSIONS} set with all versions it contains the binaries of
for citus_version in ${CITUS_VERSIONS}; do \ for citus_version in ${CITUS_VERSIONS}; do \
gosu circleci \ gosu circleci \
make -C src/test/regress \ make -C src/test/regress \
@ -385,7 +391,7 @@ jobs:
citus-post-tar=${GITHUB_WORKSPACE}/install-$PG_MAJOR.tar; \ citus-post-tar=${GITHUB_WORKSPACE}/install-$PG_MAJOR.tar; \
done; done;
# run make check-citus-upgrade-mixed for all citus versions # run make check-citus-upgrade-mixed for all citus versions
# the image has ${CITUS_VERSIONS} set with all verions it contains the binaries of # the image has ${CITUS_VERSIONS} set with all versions it contains the binaries of
for citus_version in ${CITUS_VERSIONS}; do \ for citus_version in ${CITUS_VERSIONS}; do \
gosu circleci \ gosu circleci \
make -C src/test/regress \ make -C src/test/regress \

View File

@ -1,31 +1,18 @@
-- Citus upgrades are finished by calling a procedure -- Citus upgrades are finished by calling a procedure
-- Note that pg_catalog.citus_finish_citus_upgrade() behaves differently
-- when last upgrade citus version is less than 11
-- so we have two alternative outputs for this test
\set upgrade_test_old_citus_version `echo "$CITUS_OLD_VERSION"`
SELECT substring(:'upgrade_test_old_citus_version', 'v(\d+)\.\d+\.\d+')::int < 11
AS upgrade_test_old_citus_version_lt_11_0;
upgrade_test_old_citus_version_lt_11_0
---------------------------------------------------------------------
t
(1 row)
-- this is a transactional procedure, so rollback should be fine -- this is a transactional procedure, so rollback should be fine
BEGIN; BEGIN;
CALL citus_finish_citus_upgrade(); CALL citus_finish_citus_upgrade();
NOTICE: Preparing all the existing partitioned table indexes NOTICE: already at the latest distributed schema version (12.1-1)
NOTICE: Preparing to sync the metadata to all nodes
ROLLBACK; ROLLBACK;
-- do the actual job -- do the actual job
CALL citus_finish_citus_upgrade(); CALL citus_finish_citus_upgrade();
NOTICE: Preparing all the existing partitioned table indexes NOTICE: already at the latest distributed schema version (12.1-1)
NOTICE: Preparing to sync the metadata to all nodes
-- show that the upgrade is successfull -- show that the upgrade is successfull
SELECT metadata->>'last_upgrade_version' = extversion SELECT metadata->>'last_upgrade_version' = extversion
FROM pg_dist_node_metadata, pg_extension WHERE extname = 'citus'; FROM pg_dist_node_metadata, pg_extension WHERE extname = 'citus';
?column? ?column?
--------------------------------------------------------------------- ---------------------------------------------------------------------
t f
(1 row) (1 row)
-- idempotent, should be called multiple times -- idempotent, should be called multiple times

View File

@ -1,15 +1,4 @@
-- Citus upgrades are finished by calling a procedure -- Citus upgrades are finished by calling a procedure
-- Note that pg_catalog.citus_finish_citus_upgrade() behaves differently
-- when last upgrade citus version is less than 11
-- so we have two alternative outputs for this test
\set upgrade_test_old_citus_version `echo "$CITUS_OLD_VERSION"`
SELECT substring(:'upgrade_test_old_citus_version', 'v(\d+)\.\d+\.\d+')::int < 11
AS upgrade_test_old_citus_version_lt_11_0;
upgrade_test_old_citus_version_lt_11_0
---------------------------------------------------------------------
f
(1 row)
-- this is a transactional procedure, so rollback should be fine -- this is a transactional procedure, so rollback should be fine
BEGIN; BEGIN;
CALL citus_finish_citus_upgrade(); CALL citus_finish_citus_upgrade();

View File

@ -1,15 +1,4 @@
-- Citus upgrades are finished by calling a procedure -- Citus upgrades are finished by calling a procedure
-- Note that pg_catalog.citus_finish_citus_upgrade() behaves differently
-- when last upgrade citus version is less than 11
-- so we have two alternative outputs for this test
\set upgrade_test_old_citus_version `echo "$CITUS_OLD_VERSION"`
SELECT substring(:'upgrade_test_old_citus_version', 'v(\d+)\.\d+\.\d+')::int < 11
AS upgrade_test_old_citus_version_lt_11_0;
upgrade_test_old_citus_version_lt_11_0
---------------------------------------------------------------------
f
(1 row)
-- this is a transactional procedure, so rollback should be fine -- this is a transactional procedure, so rollback should be fine
BEGIN; BEGIN;
CALL citus_finish_citus_upgrade(); CALL citus_finish_citus_upgrade();

View File

@ -1,12 +1,4 @@
-- Citus upgrades are finished by calling a procedure -- Citus upgrades are finished by calling a procedure
-- Note that pg_catalog.citus_finish_citus_upgrade() behaves differently
-- when last upgrade citus version is less than 11
-- so we have two alternative outputs for this test
\set upgrade_test_old_citus_version `echo "$CITUS_OLD_VERSION"`
SELECT substring(:'upgrade_test_old_citus_version', 'v(\d+)\.\d+\.\d+')::int < 11
AS upgrade_test_old_citus_version_lt_11_0;
-- this is a transactional procedure, so rollback should be fine -- this is a transactional procedure, so rollback should be fine
BEGIN; BEGIN;
CALL citus_finish_citus_upgrade(); CALL citus_finish_citus_upgrade();