-
Notifications
You must be signed in to change notification settings - Fork 686
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update upgrade_citus_finish_citus_upgrade with 11.1 version
- Loading branch information
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
src/test/regress/expected/upgrade_citus_finish_citus_upgrade_1.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
-- 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 | ||
BEGIN; | ||
CALL citus_finish_citus_upgrade(); | ||
NOTICE: already at the latest distributed schema version (11.1-1) | ||
ROLLBACK; | ||
-- do the actual job | ||
CALL citus_finish_citus_upgrade(); | ||
NOTICE: already at the latest distributed schema version (11.1-1) | ||
-- show that the upgrade is successfull | ||
SELECT metadata->>'last_upgrade_version' = extversion | ||
FROM pg_dist_node_metadata, pg_extension WHERE extname = 'citus'; | ||
?column? | ||
--------------------------------------------------------------------- | ||
f | ||
(1 row) | ||
|
||
-- idempotent, should be called multiple times | ||
-- still, do not NOTICE the version as it changes per release | ||
SET client_min_messages TO WARNING; | ||
CALL citus_finish_citus_upgrade(); | ||
-- we should be able to sync metadata in nontransactional way as well | ||
SET citus.metadata_sync_mode TO 'nontransactional'; | ||
SELECT start_metadata_sync_to_all_nodes(); | ||
start_metadata_sync_to_all_nodes | ||
--------------------------------------------------------------------- | ||
t | ||
(1 row) | ||
|
||
RESET citus.metadata_sync_mode; |