Reproduce bug via test suite

pull/5456/head
Onur Tirtir 2021-11-10 15:15:54 +03:00
parent 4a97664fd7
commit ef2ca03f24
6 changed files with 65 additions and 9 deletions

View File

@ -3,8 +3,11 @@ test: turn_mx_off
test: multi_test_helpers multi_test_helpers_superuser
test: multi_test_catalog_views
test: upgrade_basic_before
test: upgrade_columnar_before
test: upgrade_ref2ref_before
test: upgrade_type_before
test: upgrade_distributed_function_before upgrade_rebalance_strategy_before
test: upgrade_autoconverted_before
# upgrade_columnar_before renames public schema to citus_schema, so let's
# run this test as the last one.
test: upgrade_columnar_before

View File

@ -1,9 +1,9 @@
select logicalrelid, autoconverted from pg_dist_partition
where logicalrelid IN ('citus_local_autoconverted'::regclass,
'citus_local_not_autoconverted'::regclass);
logicalrelid | autoconverted
where logicalrelid IN ('citus_schema.citus_local_autoconverted'::regclass,
'citus_schema.citus_local_not_autoconverted'::regclass);
logicalrelid | autoconverted
---------------------------------------------------------------------
citus_local_autoconverted | t
citus_local_not_autoconverted | f
citus_schema.citus_local_autoconverted | t
citus_schema.citus_local_not_autoconverted | f
(2 rows)

View File

@ -5,6 +5,33 @@ SELECT substring(:'server_version', '\d+')::int > 11 AS server_version_above_ele
\else
\q
\endif
-- Test if relying on topological sort of the objects, not their names, works
-- fine when re-creating objects during pg_upgrade.
ALTER SCHEMA public RENAME TO citus_schema;
SET search_path TO citus_schema;
-- As mentioned in https://github.com/citusdata/citus/issues/5447, it
-- is essential to already have public schema to be able to use
-- citus_prepare_pg_upgrade. Until fixing that bug, let's create public
-- schema here on all nodes.
CREATE SCHEMA IF NOT EXISTS public;
-- Do "SELECT 1" to hide port numbers
SELECT 1 FROM run_command_on_workers($$CREATE SCHEMA IF NOT EXISTS public$$);
?column?
---------------------------------------------------------------------
1
1
(2 rows)
-- create a columnar table within citus_schema
CREATE TABLE new_columnar_table (
col_1 character varying(100),
col_2 date,
col_3 character varying(100),
col_4 date
) USING columnar;
INSERT INTO new_columnar_table
SELECT ('1', '1999-01-01'::timestamp, '1', '1999-01-01'::timestamp)
FROM generate_series(1, 1000);
CREATE SCHEMA upgrade_columnar;
SET search_path TO upgrade_columnar, public;
CREATE TYPE compfoo AS (f1 int, f2 text);

View File

@ -250,11 +250,11 @@ ORDER BY 1;
type noderole
view citus_dist_stat_activity
view citus_lock_waits
view citus_schema.citus_tables
view citus_shard_indexes_on_worker
view citus_shards
view citus_shards_on_worker
view citus_stat_statements
view citus_tables
view citus_worker_stat_activity
view pg_dist_shard_placement
view time_partitions

View File

@ -1,3 +1,3 @@
select logicalrelid, autoconverted from pg_dist_partition
where logicalrelid IN ('citus_local_autoconverted'::regclass,
'citus_local_not_autoconverted'::regclass);
where logicalrelid IN ('citus_schema.citus_local_autoconverted'::regclass,
'citus_schema.citus_local_not_autoconverted'::regclass);

View File

@ -6,6 +6,32 @@ SELECT substring(:'server_version', '\d+')::int > 11 AS server_version_above_ele
\q
\endif
-- Test if relying on topological sort of the objects, not their names, works
-- fine when re-creating objects during pg_upgrade.
ALTER SCHEMA public RENAME TO citus_schema;
SET search_path TO citus_schema;
-- As mentioned in https://github.com/citusdata/citus/issues/5447, it
-- is essential to already have public schema to be able to use
-- citus_prepare_pg_upgrade. Until fixing that bug, let's create public
-- schema here on all nodes.
CREATE SCHEMA IF NOT EXISTS public;
-- Do "SELECT 1" to hide port numbers
SELECT 1 FROM run_command_on_workers($$CREATE SCHEMA IF NOT EXISTS public$$);
-- create a columnar table within citus_schema
CREATE TABLE new_columnar_table (
col_1 character varying(100),
col_2 date,
col_3 character varying(100),
col_4 date
) USING columnar;
INSERT INTO new_columnar_table
SELECT ('1', '1999-01-01'::timestamp, '1', '1999-01-01'::timestamp)
FROM generate_series(1, 1000);
CREATE SCHEMA upgrade_columnar;
SET search_path TO upgrade_columnar, public;