citusdata / citus

Distributed PostgreSQL as an extension
https://www.citusdata.com
GNU Affero General Public License v3.0
10.39k stars 662 forks source link

make check: 4 of 287 tests failed #4932

Open joelonsql opened 3 years ago

joelonsql commented 3 years ago
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.2 LTS
Release:    20.04
Codename:   focal

$ psql --version
psql (PostgreSQL) 13.2 (Ubuntu 13.2-1.pgdg20.04+1)

$ cat regression.diffs
diff -dU10 -w /tmp/citus/src/test/regress/expected/multi_extension.out /tmp/citus/src/test/regress/results/multi_extension.out
--- /tmp/citus/src/test/regress/expected/multi_extension.out.modified   2021-04-26 20:34:54.140786239 +0000
+++ /tmp/citus/src/test/regress/results/multi_extension.out.modified    2021-04-26 20:34:54.160788459 +0000
@@ -317,139 +317,139 @@
                  | view citus_shard_indexes_on_worker
                  | view citus_shards_on_worker
                  | view citus_stat_statements
                  | view citus_worker_stat_activity
                  | view pg_dist_shard_placement
(188 rows)

-- Test downgrade to 9.2-2 from 9.2-4
ALTER EXTENSION citus UPDATE TO '9.2-4';
ALTER EXTENSION citus UPDATE TO '9.2-2';
+ERROR:  extension "citus" has no update path from version "9.2-4" to version "9.2-2"
-- Should be empty result since upgrade+downgrade should be a no-op
SELECT * FROM print_extension_changes();
  previous_object | current_object
-----------------+----------------
(0 rows)

/*
  * As we mistakenly bumped schema version to 9.3-1 in a bad release, we support
  * updating citus schema from 9.3-1 to 9.2-4, but we do not support updates to 9.3-1.
  *
  * Hence the query below should fail.
  */
ALTER EXTENSION citus UPDATE TO '9.3-1';
-ERROR:  extension "citus" has no update path from version "9.2-2" to version "9.3-1"
+ERROR:  extension "citus" has no update path from version "9.2-4" to version "9.3-1"
ALTER EXTENSION citus UPDATE TO '9.2-4';
+NOTICE:  version "9.2-4" of extension "citus" is already installed
-- Snapshot of state at 9.2-4
SELECT * FROM print_extension_changes();
  previous_object | current_object
-----------------+----------------
(0 rows)

-- Test downgrade to 9.2-4 from 9.3-2
ALTER EXTENSION citus UPDATE TO '9.3-2';
ALTER EXTENSION citus UPDATE TO '9.2-4';
+ERROR:  extension "citus" has no update path from version "9.3-2" to version "9.2-4"
-- Should be empty result since upgrade+downgrade should be a no-op
SELECT * FROM print_extension_changes();
  previous_object |                         current_object
-----------------+-----------------------------------------------------------------
-(0 rows)
-
--- Snapshot of state at 9.3-2
-ALTER EXTENSION citus UPDATE TO '9.3-2';
-SELECT * FROM print_extension_changes();
- previous_object |                         current_object
----------------------------------------------------------------------
                  | function citus_remote_connection_stats()
                  | function replicate_reference_tables()
                  | function truncate_local_data_after_distributing_table(regclass)
                  | function update_distributed_table_colocation(regclass,text)
                  | function worker_create_or_alter_role(text,text,text)
(5 rows)

--- Test downgrade to 9.3-2 from 9.4-1
-ALTER EXTENSION citus UPDATE TO '9.4-1';
+-- Snapshot of state at 9.3-2
ALTER EXTENSION citus UPDATE TO '9.3-2';
--- Should be empty result since upgrade+downgrade should be a no-op
+NOTICE:  version "9.3-2" of extension "citus" is already installed
SELECT * FROM print_extension_changes();
  previous_object | current_object
-----------------+----------------
(0 rows)

--- Snapshot of state at 9.4-1
+-- Test downgrade to 9.3-2 from 9.4-1
ALTER EXTENSION citus UPDATE TO '9.4-1';
+ALTER EXTENSION citus UPDATE TO '9.3-2';
+ERROR:  extension "citus" has no update path from version "9.4-1" to version "9.3-2"
+-- Should be empty result since upgrade+downgrade should be a no-op
SELECT * FROM print_extension_changes();
  previous_object |                     current_object
-----------------+--------------------------------------------------------
                  | function worker_last_saved_explain_analyze()
                  | function worker_save_query_explain_analyze(text,jsonb)
(2 rows)

+-- Snapshot of state at 9.4-1
+ALTER EXTENSION citus UPDATE TO '9.4-1';
+NOTICE:  version "9.4-1" of extension "citus" is already installed
+SELECT * FROM print_extension_changes();
+ previous_object | current_object
+-----------------+----------------
+(0 rows)
+
-- Test downgrade to 9.4-1 from 9.5-1
ALTER EXTENSION citus UPDATE TO '9.5-1';
BEGIN;
  SELECT master_add_node('localhost', :master_port, groupId=>0);
  master_add_node
-----------------
                1
(1 row)

  CREATE TABLE citus_local_table (a int);
  SELECT create_citus_local_table('citus_local_table');
NOTICE:  create_citus_local_table is deprecated in favour of citus_add_local_table_to_metadata
  create_citus_local_table
--------------------------

(1 row)

  -- downgrade from 9.5-1 to 9.4-1 should fail as we have a citus local table
  ALTER EXTENSION citus UPDATE TO '9.4-1';
-ERROR:  citus local tables are introduced in Citus 9.5
-HINT:  To downgrade Citus to an older version, you should first convert each citus local table to a postgres table by executing SELECT undistribute_table("%s")
-CONTEXT:  PL/pgSQL function inline_code_block line 11 at RAISE
+ERROR:  extension "citus" has no update path from version "9.5-1" to version "9.4-1"
ROLLBACK;
-- now we can downgrade as there is no citus local table
ALTER EXTENSION citus UPDATE TO '9.4-1';
+ERROR:  extension "citus" has no update path from version "9.5-1" to version "9.4-1"
-- Should be empty result since upgrade+downgrade should be a no-op
SELECT * FROM print_extension_changes();
                            previous_object                           |                           current_object
---------------------------------------------------------------------+--------------------------------------------------------------------
-(0 rows)
-
--- Snapshot of state at 9.5-1
-ALTER EXTENSION citus UPDATE TO '9.5-1';
-SELECT * FROM print_extension_changes();
-                           previous_object                           |                           current_object
----------------------------------------------------------------------
  function master_drop_sequences(text[])                              |
  function task_tracker_assign_task(bigint,integer,text)              |
  function task_tracker_cleanup_job(bigint)                           |
  function task_tracker_conninfo_cache_invalidate()                   |
  function task_tracker_task_status(bigint,integer)                   |
  function worker_execute_sql_task(bigint,integer,text,boolean)       |
  function worker_merge_files_and_run_query(bigint,integer,text,text) |
                                                                      | function create_citus_local_table(regclass)
                                                                      | function undistribute_table(regclass)
                                                                      | function worker_record_sequence_dependency(regclass,regclass,name)
(10 rows)

--- Test downgrade to 9.5-1 from 10.0-1
-ALTER EXTENSION citus UPDATE TO '10.0-1';
+-- Snapshot of state at 9.5-1
ALTER EXTENSION citus UPDATE TO '9.5-1';
--- Should be empty result since upgrade+downgrade should be a no-op
+NOTICE:  version "9.5-1" of extension "citus" is already installed
SELECT * FROM print_extension_changes();
  previous_object | current_object
-----------------+----------------
(0 rows)

--- Snapshot of state at 10.0-1
+-- Test downgrade to 9.5-1 from 10.0-1
ALTER EXTENSION citus UPDATE TO '10.0-1';
+ALTER EXTENSION citus UPDATE TO '9.5-1';
+ERROR:  extension "citus" has no update path from version "10.0-1" to version "9.5-1"
+-- Should be empty result since upgrade+downgrade should be a no-op
SELECT * FROM print_extension_changes();
                                  previous_object                                 |                                             current_object
---------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------
  function citus_total_relation_size(regclass)                                    |
  function create_citus_local_table(regclass)                                     |
  function mark_tables_colocated(regclass,regclass[])                             |
  function master_conninfo_cache_invalidate()                                     |
  function master_create_distributed_table(regclass,text,citus.distribution_type) |
  function master_create_worker_shards(text,integer,integer)                      |
  function master_dist_local_group_cache_invalidate()                             |
@@ -508,75 +508,89 @@
                                                                                  | sequence columnar.storageid_seq
                                                                                  | table columnar.chunk
                                                                                  | table columnar.chunk_group
                                                                                  | table columnar.options
                                                                                  | table columnar.stripe
                                                                                  | view citus_shards
                                                                                  | view citus_tables
                                                                                  | view time_partitions
(67 rows)

+-- Snapshot of state at 10.0-1
+ALTER EXTENSION citus UPDATE TO '10.0-1';
+NOTICE:  version "10.0-1" of extension "citus" is already installed
+SELECT * FROM print_extension_changes();
+ previous_object | current_object
+-----------------+----------------
+(0 rows)
+
-- Test downgrade to 10.0-1 from 10.0-2
ALTER EXTENSION citus UPDATE TO '10.0-2';
ALTER EXTENSION citus UPDATE TO '10.0-1';
+ERROR:  extension "citus" has no update path from version "10.0-2" to version "10.0-1"
-- Should be empty result since upgrade+downgrade should be a no-op
SELECT * FROM print_extension_changes();
  previous_object | current_object
-----------------+----------------
(0 rows)

-- Snapshot of state at 10.0-2
ALTER EXTENSION citus UPDATE TO '10.0-2';
+NOTICE:  version "10.0-2" of extension "citus" is already installed
SELECT * FROM print_extension_changes();
  previous_object | current_object
-----------------+----------------
(0 rows)

-- Test downgrade to 10.0-2 from 10.0-3
ALTER EXTENSION citus UPDATE TO '10.0-3';
ALTER EXTENSION citus UPDATE TO '10.0-2';
+ERROR:  extension "citus" has no update path from version "10.0-3" to version "10.0-2"
-- Should be empty result since upgrade+downgrade should be a no-op
SELECT * FROM print_extension_changes();
  previous_object |              current_object
-----------------+------------------------------------------
-(0 rows)
+                 | function citus_get_active_worker_nodes()
+(1 row)

-- Snapshot of state at 10.0-3
ALTER EXTENSION citus UPDATE TO '10.0-3';
+NOTICE:  version "10.0-3" of extension "citus" is already installed
SELECT * FROM print_extension_changes();
  previous_object | current_object
-----------------+----------------
-                 | function citus_get_active_worker_nodes()
-(1 row)
+(0 rows)

-- Test downgrade to 10.0-3 from 10.1-1
ALTER EXTENSION citus UPDATE TO '10.1-1';
ALTER EXTENSION citus UPDATE TO '10.0-3';
+ERROR:  extension "citus" has no update path from version "10.1-1" to version "10.0-3"
-- Should be empty result since upgrade+downgrade should be a no-op
SELECT * FROM print_extension_changes();
                                previous_object                                |                                    current_object
-------------------------------------------------------------------------------+---------------------------------------------------------------------------------------
-(0 rows)
-
--- Snapshot of state at 10.1-1
-ALTER EXTENSION citus UPDATE TO '10.1-1';
-SELECT * FROM print_extension_changes();
-                                previous_object                                |                                    current_object
----------------------------------------------------------------------
  function citus_internal.columnar_ensure_objects_exist()                       |
  function create_distributed_table(regclass,text,citus.distribution_type,text) |
                                                                                | function create_distributed_table(regclass,text,citus.distribution_type,text,integer)
                                                                                | function worker_partitioned_relation_size(regclass)
                                                                                | function worker_partitioned_relation_total_size(regclass)
                                                                                | function worker_partitioned_table_size(regclass)
(6 rows)

+-- Snapshot of state at 10.1-1
+ALTER EXTENSION citus UPDATE TO '10.1-1';
+NOTICE:  version "10.1-1" of extension "citus" is already installed
+SELECT * FROM print_extension_changes();
+ previous_object | current_object
+-----------------+----------------
+(0 rows)
+
DROP TABLE prev_objects, extension_diff;
-- show running version
SHOW citus.version;
  citus.version
---------------
  10.1devel
(1 row)

-- ensure no unexpected objects were created outside pg_catalog
SELECT pgio.type, pgio.identity
diff -dU10 -w /tmp/citus/src/test/regress/expected/multi_partitioning.out /tmp/citus/src/test/regress/results/multi_partitioning.out
--- /tmp/citus/src/test/regress/expected/multi_partitioning.out.modified    2021-04-26 20:35:36.368624520 +0000
+++ /tmp/citus/src/test/regress/results/multi_partitioning.out.modified 2021-04-26 20:35:36.404627314 +0000
@@ -614,21 +614,21 @@
    name    |  type
------------+---------
  id         | integer
  new_column | integer
  time       | date
(3 rows)

-- test add PRIMARY KEY
-- add PRIMARY KEY to partitioned table - this will error out
ALTER TABLE partitioning_test ADD CONSTRAINT partitioning_primary PRIMARY KEY (id);
-ERROR:  insufficient columns in PRIMARY KEY constraint definition
+ERROR:  unique constraint on partitioned table must include all partitioning columns
DETAIL:  PRIMARY KEY constraint on table "partitioning_test" lacks column "time" which is part of the partition key.
-- ADD PRIMARY KEY to partition
ALTER TABLE partitioning_test_2009 ADD CONSTRAINT partitioning_2009_primary PRIMARY KEY (id);
-- see PRIMARY KEY is created
SELECT
    table_name,
    constraint_name,
    constraint_type
FROM
    information_schema.table_constraints
@@ -1943,26 +1943,26 @@
      FOR VALUES FROM ('2009-01-01') TO ('2010-01-01');
-- Attach a table which doesn't have the constraint
ALTER TABLE partitioning_test ATTACH PARTITION partitioning_test_2010
      FOR VALUES FROM ('2010-01-01') TO ('2011-01-01');
-- Attach a table which has a different constraint
ALTER TABLE partitioning_test ATTACH PARTITION partitioning_test_2011
      FOR VALUES FROM ('2011-01-01') TO ('2012-01-01');
SELECT parent_table, partition_column, partition, from_value, to_value FROM time_partitions;
                parent_table               | partition_column |                 partition                  | from_value |  to_value
------------------------------------------+------------------+--------------------------------------------+------------+------------
- "schema-test"                            | time             | "schema-test_2009"                         | 01-01-2009 | 01-01-2010
  partitioning_test                        | time             | partitioning_test_2008                     | 01-01-2008 | 01-01-2009
  partitioning_test                        | time             | partitioning_test_2009                     | 01-01-2009 | 01-01-2010
  partitioning_test                        | time             | partitioning_test_2010                     | 01-01-2010 | 01-01-2011
  partitioning_test                        | time             | partitioning_test_2011                     | 01-01-2011 | 01-01-2012
  public.non_distributed_partitioned_table | a                | public.non_distributed_partitioned_table_1 | 0          | 10
+ "schema-test"                            | time             | "schema-test_2009"                         | 01-01-2009 | 01-01-2010
(6 rows)

-- create the same partition to verify it behaves like in plain PG
CREATE TABLE partitioning_test_2011 PARTITION OF partitioning_test FOR VALUES FROM ('2011-01-01') TO ('2012-01-01');
ERROR:  relation "partitioning_test_2011" already exists
CREATE TABLE IF NOT EXISTS partitioning_test_2011 PARTITION OF partitioning_test FOR VALUES FROM ('2011-01-01') TO ('2012-01-01');
NOTICE:  relation "partitioning_test_2011" already exists, skipping
-- verify we can create a partition that doesn't already exist with IF NOT EXISTS
CREATE TABLE IF NOT EXISTS partitioning_test_2013 PARTITION OF partitioning_test FOR VALUES FROM ('2013-01-01') TO ('2014-01-01');
SELECT logicalrelid FROM pg_dist_partition WHERE logicalrelid IN ('partitioning_test', 'partitioning_test_2013') ORDER BY 1;
diff -dU10 -w /tmp/citus/src/test/regress/expected/pg13.out /tmp/citus/src/test/regress/results/pg13.out
--- /tmp/citus/src/test/regress/expected/pg13.out.modified  2021-04-26 20:36:45.661508394 +0000
+++ /tmp/citus/src/test/regress/results/pg13.out.modified   2021-04-26 20:36:45.669508929 +0000
@@ -126,22 +126,22 @@
-- test unicode escape
-- insert the word 'data' with unicode escapes
INSERT INTO text_table VALUES(U&'d\0061t\+000061');
-- insert the word слон
INSERT INTO text_table VALUES(U&'\0441\043B\043E\043D');
SELECT * FROM text_table ORDER BY 1;
  name
------
  abc
  äbc
- data
  äbc
+ data
  слон
(5 rows)

-- Test that we don't propagate base types
CREATE TYPE myvarchar;
CREATE FUNCTION myvarcharin(cstring, oid, integer) RETURNS myvarchar
LANGUAGE internal IMMUTABLE PARALLEL SAFE STRICT AS 'varcharin';
NOTICE:  return type myvarchar is only a shell
CREATE FUNCTION myvarcharout(myvarchar) RETURNS cstring
LANGUAGE internal IMMUTABLE PARALLEL SAFE STRICT AS 'varcharout';
diff -dU10 -w /tmp/citus/src/test/regress/expected/alter_distributed_table.out /tmp/citus/src/test/regress/results/alter_distributed_table.out
--- /tmp/citus/src/test/regress/expected/alter_distributed_table.out.modified   2021-04-26 20:38:21.748112266 +0000
+++ /tmp/citus/src/test/regress/results/alter_distributed_table.out.modified    2021-04-26 20:38:21.772110402 +0000
@@ -125,22 +125,22 @@
--------------------+------------------+---------------------+-------------
  colocation_table   | distributed      | a                   |           4
  colocation_table_2 | distributed      | a                   |           4
  dist_table         | distributed      | b                   |           4
(3 rows)

SELECT STRING_AGG(table_name::text, ', ' ORDER BY 1) AS "Colocation Groups" FROM public.citus_tables
    WHERE table_name IN ('dist_table', 'colocation_table', 'colocation_table_2') GROUP BY colocation_id ORDER BY 1;
      Colocation Groups
------------------------------
- colocation_table, dist_table
  colocation_table_2
+ colocation_table, dist_table
(2 rows)

-- test altering shard count with cascading, note that the colocation will be kept
SELECT alter_distributed_table('dist_table', shard_count := 8, cascade_to_colocated := true);
NOTICE:  creating a new table for alter_distributed_table.dist_table
NOTICE:  moving the data of alter_distributed_table.dist_table
NOTICE:  dropping the old alter_distributed_table.dist_table
NOTICE:  renaming the new table to alter_distributed_table.dist_table
NOTICE:  creating a new table for alter_distributed_table.colocation_table
NOTICE:  moving the data of alter_distributed_table.colocation_table
@@ -157,22 +157,22 @@
--------------------+------------------+---------------------+-------------
  colocation_table   | distributed      | a                   |           8
  colocation_table_2 | distributed      | a                   |           4
  dist_table         | distributed      | b                   |           8
(3 rows)

SELECT STRING_AGG(table_name::text, ', ' ORDER BY 1) AS "Colocation Groups" FROM public.citus_tables
    WHERE table_name IN ('dist_table', 'colocation_table', 'colocation_table_2') GROUP BY colocation_id ORDER BY 1;
      Colocation Groups
------------------------------
- colocation_table, dist_table
  colocation_table_2
+ colocation_table, dist_table
(2 rows)

-- test altering shard count without cascading, note that the colocation will be broken
SELECT alter_distributed_table('dist_table', shard_count := 10, cascade_to_colocated := false);
NOTICE:  creating a new table for alter_distributed_table.dist_table
NOTICE:  moving the data of alter_distributed_table.dist_table
NOTICE:  dropping the old alter_distributed_table.dist_table
NOTICE:  renaming the new table to alter_distributed_table.dist_table
  alter_distributed_table
-------------------------
postgres@pithub:/tmp/citus/src/test/regress$
onderkalaci commented 3 years ago

As far as I can see, this is the same with #4081.

Citus implements downgrade scripts, which allows to downgrade versions. We should do (or at least document) make install-all to install the downgrade scripts, and the failing tests are failing because there is no downgrade scripts.

Can you retry with make install-all? Because, I still suspect one (or two?) of the failures are irrelevant to the above

joelonsql commented 3 years ago

Hi,

Thanks for explaining.

I tried make install-all, result below:

$ make check
'/usr/bin/perl' /tmp/citus/src/test/regress/pg_regress_multi.pl --pgxsdir="/usr/lib/postgresql/13/lib/pgxs" --bindir="/usr/lib/postgresql/13/bin" --libdir="/usr/lib/x86_64-linux-gnu" --majorversion="13" --postgres-builddir="/build/postgresql-13/build"  --postgres-srcdir="/build/postgresql-13/build/.." --load-extension=citus \
-- --inputdir=/tmp/citus/src/test/regress   --launcher="/tmp/citus/src/test/regress/log_test_times" --schedule=/tmp/citus/src/test/regress/multi_schedule
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.UTF-8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

creating directory tmp_check/master/data ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... Etc/UTC
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok

Sync to disk skipped.
The data directory might become corrupt if the operating system crashes.

initdb: warning: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.

Success. You can now start the database server using:

    /usr/lib/postgresql/13/bin/pg_ctl -D tmp_check/master/data -l logfile start

waiting for server to start.... done
server started
waiting for server to start.... done
server started
waiting for server to start.... done
server started
CREATE DATABASE
CREATE EXTENSION
CREATE FUNCTION
CREATE FOREIGN DATA WRAPPER
CREATE SERVER
CREATE DATABASE
CREATE EXTENSION
CREATE FUNCTION
CREATE FOREIGN DATA WRAPPER
CREATE SERVER
(using postmaster on localhost, port 57636)
============== dropping database "regression"         ==============
NOTICE:  database "regression" does not exist, skipping
DROP DATABASE
============== creating database "regression"         ==============
CREATE DATABASE
ALTER DATABASE
============== installing citus                       ==============
CREATE EXTENSION
============== running regression test queries        ==============
test multi_extension              ... FAILED     2004 ms
test single_node                  ... ok         2831 ms
test multi_cluster_management     ... ok          424 ms
test alter_role_propagation       ... ok          717 ms
test propagate_extension_commands ... ok         1816 ms
test escape_extension_name        ... ok          162 ms
test ref_citus_local_fkeys        ... ok          197 ms
parallel group (2 tests):  multi_test_helpers multi_test_helpers_superuser
    multi_test_helpers           ... ok           31 ms
    multi_test_helpers_superuser ... ok           34 ms
test multi_test_catalog_views     ... ok           56 ms
test multi_table_ddl              ... ok          255 ms
test multi_name_lengths           ... ok          713 ms
test multi_name_resolution        ... ok           70 ms
test multi_metadata_access        ... ok           14 ms
test multi_metadata_attributes    ... ok           13 ms
test multi_read_from_secondaries  ... ok          149 ms
test multi_create_table           ... ok          461 ms
test multi_create_table_superuser ... ok         2061 ms
parallel group (5 tests):  multi_master_protocol multi_load_data multi_load_data_superuser multi_create_table_constraints multi_behavioral_analytics_create_table
    multi_create_table_constraints ... ok         1730 ms
    multi_master_protocol        ... ok           71 ms
    multi_load_data              ... ok         1000 ms
    multi_load_data_superuser    ... ok         1425 ms
    multi_behavioral_analytics_create_table ... ok         1778 ms
parallel group (5 tests):  multi_insert_select_non_pushable_queries multi_behavioral_analytics_single_shard_queries multi_behavioral_analytics_basics multi_behavioral_analytics_create_table_superuser multi_insert_select
    multi_behavioral_analytics_basics ... ok         1345 ms
    multi_behavioral_analytics_single_shard_queries ... ok          893 ms
    multi_insert_select_non_pushable_queries ... ok          864 ms
    multi_insert_select          ... ok         5338 ms
    multi_behavioral_analytics_create_table_superuser ... ok         1903 ms
parallel group (2 tests):  recursive_dml_with_different_planners_executors multi_shard_update_delete
    multi_shard_update_delete    ... ok         1774 ms
    recursive_dml_with_different_planners_executors ... ok         1228 ms
parallel group (4 tests):  window_functions multi_insert_select_window dml_recursive insert_select_repartition
    insert_select_repartition    ... ok         4292 ms
    window_functions             ... ok         1045 ms
    dml_recursive                ... ok         2927 ms
    multi_insert_select_window   ... ok         2068 ms
parallel group (2 tests):  citus_table_triggers multi_insert_select_conflict
    multi_insert_select_conflict ... ok          875 ms
    citus_table_triggers         ... ok          274 ms
parallel group (4 tests):  multi_create_table_new_features multi_row_insert alter_index insert_select_into_local_table
    multi_row_insert             ... ok          141 ms
    insert_select_into_local_table ... ok          418 ms
    multi_create_table_new_features ... ok           71 ms
    alter_index                  ... ok          350 ms
test insert_select_connection_leak ... ok         1614 ms
test ensure_no_intermediate_data_leak ... ok          134 ms
parallel group (4 tests):  multi_partitioning_utils partitioning_issue_3970 replicated_partitioned_table multi_partitioning
    multi_partitioning_utils     ... ok          659 ms
    multi_partitioning           ... FAILED     3168 ms
    partitioning_issue_3970      ... ok          800 ms
    replicated_partitioned_table ... ok         1807 ms
test multi_create_fdw             ... ok           14 ms
test subquery_basics              ... ok          194 ms
test subquery_local_tables        ... ok          313 ms
test subquery_executors           ... ok          969 ms
test subquery_and_cte             ... ok         1292 ms
test set_operations               ... ok          925 ms
test union_pushdown               ... ok        37455 ms
test set_operation_and_local_tables ... ok          636 ms
parallel group (4 tests):  subqueries_not_supported subqueries_deep subquery_partitioning subquery_view
    subqueries_deep              ... ok          316 ms
    subquery_view                ... ok         1659 ms
    subquery_partitioning        ... ok         1115 ms
    subqueries_not_supported     ... ok          199 ms
parallel group (3 tests):  subquery_in_targetlist subquery_in_where subquery_complex_target_list
    subquery_in_targetlist       ... ok          766 ms
    subquery_in_where            ... ok          842 ms
    subquery_complex_target_list ... ok         1751 ms
test subquery_prepared_statements ... ok          195 ms
parallel group (3 tests):  non_colocated_leaf_subquery_joins non_colocated_join_order non_colocated_subquery_joins
    non_colocated_leaf_subquery_joins ... ok          191 ms
    non_colocated_subquery_joins ... ok         1073 ms
    non_colocated_join_order     ... ok          379 ms
parallel group (3 tests):  recursive_view_local_table values cte_inline
    cte_inline                   ... ok         2067 ms
    recursive_view_local_table   ... ok          274 ms
    values                       ... ok          799 ms
parallel group (2 tests):  pg13 pg12
    pg13                         ... FAILED      262 ms
    pg12                         ... ok          915 ms
test tableam                      ... ok          664 ms
test propagate_statistics         ... ok          541 ms
test pg13_propagate_statistics    ... ok          162 ms
test citus_update_table_statistics ... ok          132 ms
parallel group (5 tests):  multi_deparse_shard_query intermediate_results limit_intermediate_size multi_distributed_transaction_id rollback_to_savepoint
    multi_deparse_shard_query    ... ok          349 ms
    multi_distributed_transaction_id ... ok         2166 ms
    intermediate_results         ... ok         1357 ms
    limit_intermediate_size      ... ok         1532 ms
    rollback_to_savepoint        ... ok         2477 ms
parallel group (5 tests):  distributed_intermediate_results multi_explain hyperscale_tutorial partitioned_intermediate_results multi_real_time_transaction
    multi_explain                ... ok         4561 ms
    hyperscale_tutorial          ... ok         5069 ms
    partitioned_intermediate_results ... ok         6722 ms
    distributed_intermediate_results ... ok         2495 ms
    multi_real_time_transaction  ... ok         7334 ms
parallel group (6 tests):  multi_basic_queries multi_complex_expressions multi_subquery_behavioral_analytics cross_join multi_subquery multi_subquery_complex_queries
    multi_basic_queries          ... ok          295 ms
    cross_join                   ... ok         2915 ms
    multi_complex_expressions    ... ok         2444 ms
    multi_subquery               ... ok         3463 ms
    multi_subquery_complex_queries ... ok        12130 ms
    multi_subquery_behavioral_analytics ... ok         2619 ms
parallel group (5 tests):  multi_sql_function multi_subquery_window_functions multi_prepare_sql multi_view multi_subquery_complex_reference_clause
    multi_subquery_complex_reference_clause ... ok         3794 ms
    multi_subquery_window_functions ... ok         1206 ms
    multi_view                   ... ok         3309 ms
    multi_sql_function           ... ok          767 ms
    multi_prepare_sql            ... ok         2019 ms
parallel group (5 tests):  multi_function_in_join sql_procedure undistribute_table row_types materialized_view
    sql_procedure                ... ok          998 ms
    multi_function_in_join       ... ok          954 ms
    row_types                    ... ok         1303 ms
    materialized_view            ... ok         2419 ms
    undistribute_table           ... ok         1249 ms
parallel group (4 tests):  propagate_set_commands multi_subquery_in_where_reference_clause adaptive_executor geqo
    multi_subquery_in_where_reference_clause ... ok          458 ms
    adaptive_executor            ... ok          554 ms
    propagate_set_commands       ... ok          266 ms
    geqo                         ... ok         1856 ms
test join_pushdown                ... ok         2780 ms
parallel group (4 tests):  multi_subquery_misc multi_subquery_in_where_clause statement_cancel_error_message multi_subquery_union
    multi_subquery_union         ... ok          847 ms
    multi_subquery_in_where_clause ... ok          659 ms
    multi_subquery_misc          ... ok          576 ms
    statement_cancel_error_message ... ok          785 ms
parallel group (7 tests):  set_role_in_transaction multi_limit_clause_approximate multi_agg_approximate_distinct multi_prepare_plsql multi_single_relation_subquery multi_agg_distinct multi_outer_join_reference
    multi_agg_distinct           ... ok         2415 ms
    multi_agg_approximate_distinct ... ok         1566 ms
    multi_limit_clause_approximate ... ok         1553 ms
    multi_outer_join_reference   ... ok         2537 ms
    multi_single_relation_subquery ... ok         2223 ms
    multi_prepare_plsql          ... ok         1700 ms
    set_role_in_transaction      ... ok         1350 ms
parallel group (4 tests):  multi_select_for_update pg13_with_ties relation_access_tracking multi_reference_table
    multi_reference_table        ... ok         3397 ms
    multi_select_for_update      ... ok          341 ms
    relation_access_tracking     ... ok         2423 ms
    pg13_with_ties               ... ok          837 ms
parallel group (3 tests):  tdigest_aggregate_support custom_aggregate_support aggregate_support
    custom_aggregate_support     ... ok         1324 ms
    aggregate_support            ... ok         1679 ms
    tdigest_aggregate_support    ... ok          306 ms
parallel group (4 tests):  having_subquery multi_average_expression multi_having_pushdown multi_working_columns
    multi_average_expression     ... ok          176 ms
    multi_working_columns        ... ok          248 ms
    multi_having_pushdown        ... ok          225 ms
    having_subquery              ... ok          148 ms
parallel group (3 tests):  multi_array_agg multi_orderby_limit_pushdown multi_limit_clause
    multi_array_agg              ... ok          164 ms
    multi_limit_clause           ... ok          698 ms
    multi_orderby_limit_pushdown ... ok          266 ms
parallel group (9 tests):  multi_jsonb_agg multi_json_agg multi_jsonb_object_agg multi_json_object_agg bool_agg anonymous_columns ch_bench_having expression_reference_join chbenchmark_all_queries
    multi_jsonb_agg              ... ok          374 ms
    multi_jsonb_object_agg       ... ok          459 ms
    multi_json_agg               ... ok          387 ms
    multi_json_object_agg        ... ok          528 ms
    bool_agg                     ... ok          682 ms
    ch_bench_having              ... ok         1415 ms
    chbenchmark_all_queries      ... ok         5316 ms
    expression_reference_join    ... ok         2192 ms
    anonymous_columns            ... ok          911 ms
test ch_bench_subquery_repartition ... ok         1969 ms
parallel group (3 tests):  multi_count_type_conversion multi_agg_type_conversion recursive_relation_planning_restriction_pushdown
    multi_agg_type_conversion    ... ok          108 ms
    multi_count_type_conversion  ... ok           97 ms
    recursive_relation_planning_restriction_pushdown ... ok          325 ms
parallel group (2 tests):  multi_partition_pruning single_hash_repartition_join
    multi_partition_pruning      ... ok           81 ms
    single_hash_repartition_join ... ok         1467 ms
parallel group (3 tests):  multi_join_pruning multi_hash_pruning intermediate_result_pruning
    multi_join_pruning           ... ok          101 ms
    multi_hash_pruning           ... ok          457 ms
    intermediate_result_pruning  ... ok          634 ms
parallel group (2 tests):  multi_null_minmax_value_pruning cursors
    multi_null_minmax_value_pruning ... ok           79 ms
    cursors                      ... ok          207 ms
test multi_query_directory_cleanup ... ok          108 ms
parallel group (2 tests):  multi_task_assignment_policy multi_cross_shard
    multi_task_assignment_policy ... ok          210 ms
    multi_cross_shard            ... ok          623 ms
test multi_utility_statements     ... ok          156 ms
parallel group (2 tests):  multi_dropped_column_aliases foreign_key_restriction_enforcement
    multi_dropped_column_aliases ... ok           76 ms
    foreign_key_restriction_enforcement ... ok          928 ms
test binary_protocol              ... ok          137 ms
test alter_table_set_access_method ... ok          785 ms
test alter_distributed_table      ... FAILED     1331 ms
parallel group (4 tests):  multi_tpch_query6 multi_tpch_query3 multi_tpch_query10 multi_tpch_query1
    multi_tpch_query1            ... ok          137 ms
    multi_tpch_query3            ... ok          119 ms
    multi_tpch_query6            ... ok          100 ms
    multi_tpch_query10           ... ok          129 ms
parallel group (3 tests):  multi_tpch_query19 multi_tpch_query12 multi_tpch_query14
    multi_tpch_query12           ... ok           96 ms
    multi_tpch_query14           ... ok          100 ms
    multi_tpch_query19           ... ok           86 ms
parallel group (2 tests):  multi_tpch_query7_nested multi_tpch_query7
    multi_tpch_query7            ... ok           70 ms
    multi_tpch_query7_nested     ... ok           63 ms
parallel group (2 tests):  multi_join_order_tpch_small multi_join_order_additional
    multi_join_order_tpch_small  ... ok           39 ms
    multi_join_order_additional  ... ok           86 ms
test multi_load_more_data         ... ok          148 ms
test multi_join_order_tpch_repartition ... ok           16 ms
parallel group (4 tests):  multi_repartition_join_task_assignment multi_repartition_join_pruning multi_repartition_join_planning multi_repartition_join_ref
    multi_repartition_join_planning ... ok         3005 ms
    multi_repartition_join_pruning ... ok         1673 ms
    multi_repartition_join_task_assignment ... ok         1588 ms
    multi_repartition_join_ref   ... ok         9056 ms
test adaptive_executor_repartition ... ok         2614 ms
test with_prepare                 ... ok          225 ms
parallel group (4 tests):  with_nested with_set_operations with_where with_basics
    with_nested                  ... ok          482 ms
    with_where                   ... ok         1866 ms
    with_basics                  ... ok         2407 ms
    with_set_operations          ... ok         1113 ms
parallel group (3 tests):  cte_nested_modification cte_prepared_modify with_modifying
    with_modifying               ... ok         1523 ms
    cte_prepared_modify          ... ok         1071 ms
    cte_nested_modification      ... ok          712 ms
test ensure_no_intermediate_data_leak ... ok          113 ms
parallel group (5 tests):  with_partitioning with_transactions with_dml with_join with_executors
    with_executors               ... ok         6434 ms
    with_join                    ... ok         3848 ms
    with_partitioning            ... ok          507 ms
    with_transactions            ... ok         2477 ms
    with_dml                     ... ok         2681 ms
test multi_load_large_records     ... ok           46 ms
test multi_master_delete_protocol ... ok           85 ms
test multi_index_statements       ... ok         4004 ms
test multi_alter_table_statements ... ok         2709 ms
test multi_alter_table_add_constraints ... ok         2315 ms
test multi_create_schema          ... ok           49 ms
parallel group (2 tests):  multi_utility_warnings data_types
    multi_utility_warnings       ... ok           49 ms
    data_types                   ... ok          322 ms
test sequential_modifications     ... ok          766 ms
test multi_append_table_to_shard  ... ok          213 ms
test multi_outer_join             ... ok          154 ms
parallel group (2 tests):  multi_select_distinct multi_complex_count_distinct
    multi_complex_count_distinct ... ok         2493 ms
    multi_select_distinct        ... ok         1218 ms
test multi_modifications          ... ok          624 ms
test multi_distribution_metadata  ... ok          194 ms
parallel group (4 tests):  multi_create_shards multi_prune_shard_list multi_repair_shards multi_generate_ddl_commands
    multi_generate_ddl_commands  ... ok          463 ms
    multi_create_shards          ... ok          246 ms
    multi_prune_shard_list       ... ok          363 ms
    multi_repair_shards          ... ok          440 ms
parallel group (3 tests):  multi_simple_queries multi_upsert multi_data_types
    multi_upsert                 ... ok          366 ms
    multi_simple_queries         ... ok          347 ms
    multi_data_types             ... ok          449 ms
test master_copy_shard_placement  ... ok          267 ms
test multi_utilities              ... ok          278 ms
parallel group (2 tests):  validate_constraint foreign_key_to_reference_table
    foreign_key_to_reference_table ... ok         4897 ms
    validate_constraint          ... ok          392 ms
test multi_modifying_xacts        ... ok         1089 ms
parallel group (3 tests):  multi_repartition_udt multi_repartitioned_subquery_udf multi_subtransactions
    multi_repartition_udt        ... ok          653 ms
    multi_repartitioned_subquery_udf ... ok          804 ms
    multi_subtransactions        ... ok          954 ms
test multi_transaction_recovery   ... ok         1656 ms
test local_dist_join_modifications ... ok          605 ms
test local_table_join             ... ok         1050 ms
test local_dist_join_mixed        ... ok         4480 ms
test citus_local_dist_joins       ... ok         1554 ms
parallel group (3 tests):  fast_path_router_modify pg_dump multi_copy
    multi_copy                   ... ok         4004 ms
    fast_path_router_modify      ... ok          332 ms
    pg_dump                      ... ok         1765 ms
test multi_router_planner         ... ok          931 ms
test null_parameters              ... ok         1470 ms
test multi_router_planner_fast_path ... ok          161 ms
test multi_large_shardid          ... ok          241 ms
test multi_size_queries           ... ok          522 ms
test multi_drop_extension         ... ok          393 ms
test multi_metadata_sync          ... ok         1849 ms
test multi_unsupported_worker_operations ... ok          450 ms
test grant_on_schema_propagation  ... ok          864 ms
test multi_schema_support         ... ok         3851 ms
test multi_function_evaluation    ... ok          144 ms
test multi_truncate               ... ok         1699 ms
test multi_colocation_utils       ... ok          333 ms
test multi_colocated_shard_transfer ... ok          109 ms
test multi_citus_tools            ... ok          778 ms
test node_conninfo_reload         ... ok         1854 ms
test multi_foreign_key            ... ok         2379 ms
test multi_foreign_key_relation_graph ... ok          465 ms
test multi_replicate_reference_table ... ok         2045 ms
test multi_remove_node_reference_table ... ok          518 ms
test add_coordinator              ... ok           12 ms
parallel group (2 tests):  citus_local_tables_queries multi_reference_table
    multi_reference_table        ... ok         3770 ms
    citus_local_tables_queries   ... ok         3517 ms
test foreign_key_to_reference_table ... ok         5257 ms
test citus_local_table_triggers   ... ok          263 ms
test replicate_reference_tables_to_coordinator ... ok          282 ms
test coordinator_shouldhaveshards ... ok         1527 ms
test local_shard_utility_command_execution ... ok         1482 ms
test citus_local_tables           ... ok          449 ms
parallel group (3 tests):  multi_row_router_insert mixed_relkind_tests create_ref_dist_from_citus_local
    multi_row_router_insert      ... ok          193 ms
    mixed_relkind_tests          ... ok         1545 ms
    create_ref_dist_from_citus_local ... ok         1570 ms
test undistribute_table_cascade   ... ok          779 ms
test create_citus_local_table_cascade ... ok          208 ms
test fkeys_between_local_ref      ... ok          626 ms
test auto_undist_citus_local      ... ok          486 ms
test remove_coordinator           ... ok           12 ms
test multi_transactional_drop_shards ... ok          836 ms
test multi_multiuser              ... ok         1157 ms
test multi_cache_invalidation     ... ok          140 ms
test multi_task_string_size       ... ok          480 ms
test ssl_by_default               ... ok          102 ms
parallel group (4 tests):  distributed_types_xact_add_enum_value distributed_types_conflict disable_object_propagation distributed_types
    distributed_types            ... ok         1530 ms
    distributed_types_conflict   ... ok          543 ms
    disable_object_propagation   ... ok          795 ms
    distributed_types_xact_add_enum_value ... ok          409 ms
parallel group (2 tests):  distributed_functions_conflict distributed_functions
    distributed_functions        ... ok         1289 ms
    distributed_functions_conflict ... ok          398 ms
parallel group (2 tests):  distributed_collations_conflict distributed_collations
    distributed_collations       ... ok          642 ms
    distributed_collations_conflict ... ok          501 ms
test distributed_procedure        ... ok          721 ms
parallel group (2 tests):  multi_deparse_procedure multi_deparse_function
    multi_deparse_function       ... ok         1471 ms
    multi_deparse_procedure      ... ok         1124 ms
test shared_connection_stats      ... ok         4217 ms
parallel group (2 tests):  sqlsmith_failures sqlancer_failures
    sqlsmith_failures            ... ok          233 ms
    sqlancer_failures            ... ok          357 ms
test ensure_no_intermediate_data_leak ... ok          110 ms
test ensure_no_shared_connection_leak ... ok          479 ms

========================
4 of 287 tests failed.
========================

The differences that caused some tests to fail can be viewed in the
file "/tmp/citus/src/test/regress/regression.diffs".  A copy of the test summary that you see
above is saved in the file "/tmp/citus/src/test/regress/regression.out".

waiting for server to shut down.... done
server stopped
waiting for server to shut down.... done
server stopped
waiting for server to shut down.... done
server stopped
Failed in 265 seconds.
make: *** [Makefile:132: check-multi] Error 25

$ cat regression.diffs
diff -dU10 -w /tmp/citus/src/test/regress/expected/multi_extension.out /tmp/citus/src/test/regress/results/multi_extension.out
--- /tmp/citus/src/test/regress/expected/multi_extension.out.modified   2021-04-28 07:19:05.646532150 +0000
+++ /tmp/citus/src/test/regress/results/multi_extension.out.modified    2021-04-28 07:19:05.666532386 +0000
@@ -317,139 +317,139 @@
                  | view citus_shard_indexes_on_worker
                  | view citus_shards_on_worker
                  | view citus_stat_statements
                  | view citus_worker_stat_activity
                  | view pg_dist_shard_placement
(188 rows)

-- Test downgrade to 9.2-2 from 9.2-4
ALTER EXTENSION citus UPDATE TO '9.2-4';
ALTER EXTENSION citus UPDATE TO '9.2-2';
+ERROR:  extension "citus" has no update path from version "9.2-4" to version "9.2-2"
-- Should be empty result since upgrade+downgrade should be a no-op
SELECT * FROM print_extension_changes();
  previous_object | current_object
-----------------+----------------
(0 rows)

/*
  * As we mistakenly bumped schema version to 9.3-1 in a bad release, we support
  * updating citus schema from 9.3-1 to 9.2-4, but we do not support updates to 9.3-1.
  *
  * Hence the query below should fail.
  */
ALTER EXTENSION citus UPDATE TO '9.3-1';
-ERROR:  extension "citus" has no update path from version "9.2-2" to version "9.3-1"
+ERROR:  extension "citus" has no update path from version "9.2-4" to version "9.3-1"
ALTER EXTENSION citus UPDATE TO '9.2-4';
+NOTICE:  version "9.2-4" of extension "citus" is already installed
-- Snapshot of state at 9.2-4
SELECT * FROM print_extension_changes();
  previous_object | current_object
-----------------+----------------
(0 rows)

-- Test downgrade to 9.2-4 from 9.3-2
ALTER EXTENSION citus UPDATE TO '9.3-2';
ALTER EXTENSION citus UPDATE TO '9.2-4';
+ERROR:  extension "citus" has no update path from version "9.3-2" to version "9.2-4"
-- Should be empty result since upgrade+downgrade should be a no-op
SELECT * FROM print_extension_changes();
  previous_object |                         current_object
-----------------+-----------------------------------------------------------------
-(0 rows)
-
--- Snapshot of state at 9.3-2
-ALTER EXTENSION citus UPDATE TO '9.3-2';
-SELECT * FROM print_extension_changes();
- previous_object |                         current_object
----------------------------------------------------------------------
                  | function citus_remote_connection_stats()
                  | function replicate_reference_tables()
                  | function truncate_local_data_after_distributing_table(regclass)
                  | function update_distributed_table_colocation(regclass,text)
                  | function worker_create_or_alter_role(text,text,text)
(5 rows)

--- Test downgrade to 9.3-2 from 9.4-1
-ALTER EXTENSION citus UPDATE TO '9.4-1';
+-- Snapshot of state at 9.3-2
ALTER EXTENSION citus UPDATE TO '9.3-2';
--- Should be empty result since upgrade+downgrade should be a no-op
+NOTICE:  version "9.3-2" of extension "citus" is already installed
SELECT * FROM print_extension_changes();
  previous_object | current_object
-----------------+----------------
(0 rows)

--- Snapshot of state at 9.4-1
+-- Test downgrade to 9.3-2 from 9.4-1
ALTER EXTENSION citus UPDATE TO '9.4-1';
+ALTER EXTENSION citus UPDATE TO '9.3-2';
+ERROR:  extension "citus" has no update path from version "9.4-1" to version "9.3-2"
+-- Should be empty result since upgrade+downgrade should be a no-op
SELECT * FROM print_extension_changes();
  previous_object |                     current_object
-----------------+--------------------------------------------------------
                  | function worker_last_saved_explain_analyze()
                  | function worker_save_query_explain_analyze(text,jsonb)
(2 rows)

+-- Snapshot of state at 9.4-1
+ALTER EXTENSION citus UPDATE TO '9.4-1';
+NOTICE:  version "9.4-1" of extension "citus" is already installed
+SELECT * FROM print_extension_changes();
+ previous_object | current_object
+-----------------+----------------
+(0 rows)
+
-- Test downgrade to 9.4-1 from 9.5-1
ALTER EXTENSION citus UPDATE TO '9.5-1';
BEGIN;
  SELECT master_add_node('localhost', :master_port, groupId=>0);
  master_add_node
-----------------
                1
(1 row)

  CREATE TABLE citus_local_table (a int);
  SELECT create_citus_local_table('citus_local_table');
NOTICE:  create_citus_local_table is deprecated in favour of citus_add_local_table_to_metadata
  create_citus_local_table
--------------------------

(1 row)

  -- downgrade from 9.5-1 to 9.4-1 should fail as we have a citus local table
  ALTER EXTENSION citus UPDATE TO '9.4-1';
-ERROR:  citus local tables are introduced in Citus 9.5
-HINT:  To downgrade Citus to an older version, you should first convert each citus local table to a postgres table by executing SELECT undistribute_table("%s")
-CONTEXT:  PL/pgSQL function inline_code_block line 11 at RAISE
+ERROR:  extension "citus" has no update path from version "9.5-1" to version "9.4-1"
ROLLBACK;
-- now we can downgrade as there is no citus local table
ALTER EXTENSION citus UPDATE TO '9.4-1';
+ERROR:  extension "citus" has no update path from version "9.5-1" to version "9.4-1"
-- Should be empty result since upgrade+downgrade should be a no-op
SELECT * FROM print_extension_changes();
                            previous_object                           |                           current_object
---------------------------------------------------------------------+--------------------------------------------------------------------
-(0 rows)
-
--- Snapshot of state at 9.5-1
-ALTER EXTENSION citus UPDATE TO '9.5-1';
-SELECT * FROM print_extension_changes();
-                           previous_object                           |                           current_object
----------------------------------------------------------------------
  function master_drop_sequences(text[])                              |
  function task_tracker_assign_task(bigint,integer,text)              |
  function task_tracker_cleanup_job(bigint)                           |
  function task_tracker_conninfo_cache_invalidate()                   |
  function task_tracker_task_status(bigint,integer)                   |
  function worker_execute_sql_task(bigint,integer,text,boolean)       |
  function worker_merge_files_and_run_query(bigint,integer,text,text) |
                                                                      | function create_citus_local_table(regclass)
                                                                      | function undistribute_table(regclass)
                                                                      | function worker_record_sequence_dependency(regclass,regclass,name)
(10 rows)

--- Test downgrade to 9.5-1 from 10.0-1
-ALTER EXTENSION citus UPDATE TO '10.0-1';
+-- Snapshot of state at 9.5-1
ALTER EXTENSION citus UPDATE TO '9.5-1';
--- Should be empty result since upgrade+downgrade should be a no-op
+NOTICE:  version "9.5-1" of extension "citus" is already installed
SELECT * FROM print_extension_changes();
  previous_object | current_object
-----------------+----------------
(0 rows)

--- Snapshot of state at 10.0-1
+-- Test downgrade to 9.5-1 from 10.0-1
ALTER EXTENSION citus UPDATE TO '10.0-1';
+ALTER EXTENSION citus UPDATE TO '9.5-1';
+ERROR:  extension "citus" has no update path from version "10.0-1" to version "9.5-1"
+-- Should be empty result since upgrade+downgrade should be a no-op
SELECT * FROM print_extension_changes();
                                  previous_object                                 |                                             current_object
---------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------
  function citus_total_relation_size(regclass)                                    |
  function create_citus_local_table(regclass)                                     |
  function mark_tables_colocated(regclass,regclass[])                             |
  function master_conninfo_cache_invalidate()                                     |
  function master_create_distributed_table(regclass,text,citus.distribution_type) |
  function master_create_worker_shards(text,integer,integer)                      |
  function master_dist_local_group_cache_invalidate()                             |
@@ -508,75 +508,89 @@
                                                                                  | sequence columnar.storageid_seq
                                                                                  | table columnar.chunk
                                                                                  | table columnar.chunk_group
                                                                                  | table columnar.options
                                                                                  | table columnar.stripe
                                                                                  | view citus_shards
                                                                                  | view citus_tables
                                                                                  | view time_partitions
(67 rows)

+-- Snapshot of state at 10.0-1
+ALTER EXTENSION citus UPDATE TO '10.0-1';
+NOTICE:  version "10.0-1" of extension "citus" is already installed
+SELECT * FROM print_extension_changes();
+ previous_object | current_object
+-----------------+----------------
+(0 rows)
+
-- Test downgrade to 10.0-1 from 10.0-2
ALTER EXTENSION citus UPDATE TO '10.0-2';
ALTER EXTENSION citus UPDATE TO '10.0-1';
+ERROR:  extension "citus" has no update path from version "10.0-2" to version "10.0-1"
-- Should be empty result since upgrade+downgrade should be a no-op
SELECT * FROM print_extension_changes();
  previous_object | current_object
-----------------+----------------
(0 rows)

-- Snapshot of state at 10.0-2
ALTER EXTENSION citus UPDATE TO '10.0-2';
+NOTICE:  version "10.0-2" of extension "citus" is already installed
SELECT * FROM print_extension_changes();
  previous_object | current_object
-----------------+----------------
(0 rows)

-- Test downgrade to 10.0-2 from 10.0-3
ALTER EXTENSION citus UPDATE TO '10.0-3';
ALTER EXTENSION citus UPDATE TO '10.0-2';
+ERROR:  extension "citus" has no update path from version "10.0-3" to version "10.0-2"
-- Should be empty result since upgrade+downgrade should be a no-op
SELECT * FROM print_extension_changes();
  previous_object |              current_object
-----------------+------------------------------------------
-(0 rows)
+                 | function citus_get_active_worker_nodes()
+(1 row)

-- Snapshot of state at 10.0-3
ALTER EXTENSION citus UPDATE TO '10.0-3';
+NOTICE:  version "10.0-3" of extension "citus" is already installed
SELECT * FROM print_extension_changes();
  previous_object | current_object
-----------------+----------------
-                 | function citus_get_active_worker_nodes()
-(1 row)
+(0 rows)

-- Test downgrade to 10.0-3 from 10.1-1
ALTER EXTENSION citus UPDATE TO '10.1-1';
ALTER EXTENSION citus UPDATE TO '10.0-3';
+ERROR:  extension "citus" has no update path from version "10.1-1" to version "10.0-3"
-- Should be empty result since upgrade+downgrade should be a no-op
SELECT * FROM print_extension_changes();
                                previous_object                                |                                    current_object
-------------------------------------------------------------------------------+---------------------------------------------------------------------------------------
-(0 rows)
-
--- Snapshot of state at 10.1-1
-ALTER EXTENSION citus UPDATE TO '10.1-1';
-SELECT * FROM print_extension_changes();
-                                previous_object                                |                                    current_object
----------------------------------------------------------------------
  function citus_internal.columnar_ensure_objects_exist()                       |
  function create_distributed_table(regclass,text,citus.distribution_type,text) |
                                                                                | function create_distributed_table(regclass,text,citus.distribution_type,text,integer)
                                                                                | function worker_partitioned_relation_size(regclass)
                                                                                | function worker_partitioned_relation_total_size(regclass)
                                                                                | function worker_partitioned_table_size(regclass)
(6 rows)

+-- Snapshot of state at 10.1-1
+ALTER EXTENSION citus UPDATE TO '10.1-1';
+NOTICE:  version "10.1-1" of extension "citus" is already installed
+SELECT * FROM print_extension_changes();
+ previous_object | current_object
+-----------------+----------------
+(0 rows)
+
DROP TABLE prev_objects, extension_diff;
-- show running version
SHOW citus.version;
  citus.version
---------------
  10.1devel
(1 row)

-- ensure no unexpected objects were created outside pg_catalog
SELECT pgio.type, pgio.identity
diff -dU10 -w /tmp/citus/src/test/regress/expected/multi_partitioning.out /tmp/citus/src/test/regress/results/multi_partitioning.out
--- /tmp/citus/src/test/regress/expected/multi_partitioning.out.modified    2021-04-28 07:19:37.462906931 +0000
+++ /tmp/citus/src/test/regress/results/multi_partitioning.out.modified 2021-04-28 07:19:37.490907259 +0000
@@ -614,21 +614,21 @@
    name    |  type
------------+---------
  id         | integer
  new_column | integer
  time       | date
(3 rows)

-- test add PRIMARY KEY
-- add PRIMARY KEY to partitioned table - this will error out
ALTER TABLE partitioning_test ADD CONSTRAINT partitioning_primary PRIMARY KEY (id);
-ERROR:  insufficient columns in PRIMARY KEY constraint definition
+ERROR:  unique constraint on partitioned table must include all partitioning columns
DETAIL:  PRIMARY KEY constraint on table "partitioning_test" lacks column "time" which is part of the partition key.
-- ADD PRIMARY KEY to partition
ALTER TABLE partitioning_test_2009 ADD CONSTRAINT partitioning_2009_primary PRIMARY KEY (id);
-- see PRIMARY KEY is created
SELECT
    table_name,
    constraint_name,
    constraint_type
FROM
    information_schema.table_constraints
@@ -1943,26 +1943,26 @@
      FOR VALUES FROM ('2009-01-01') TO ('2010-01-01');
-- Attach a table which doesn't have the constraint
ALTER TABLE partitioning_test ATTACH PARTITION partitioning_test_2010
      FOR VALUES FROM ('2010-01-01') TO ('2011-01-01');
-- Attach a table which has a different constraint
ALTER TABLE partitioning_test ATTACH PARTITION partitioning_test_2011
      FOR VALUES FROM ('2011-01-01') TO ('2012-01-01');
SELECT parent_table, partition_column, partition, from_value, to_value FROM time_partitions;
                parent_table               | partition_column |                 partition                  | from_value |  to_value
------------------------------------------+------------------+--------------------------------------------+------------+------------
- "schema-test"                            | time             | "schema-test_2009"                         | 01-01-2009 | 01-01-2010
  partitioning_test                        | time             | partitioning_test_2008                     | 01-01-2008 | 01-01-2009
  partitioning_test                        | time             | partitioning_test_2009                     | 01-01-2009 | 01-01-2010
  partitioning_test                        | time             | partitioning_test_2010                     | 01-01-2010 | 01-01-2011
  partitioning_test                        | time             | partitioning_test_2011                     | 01-01-2011 | 01-01-2012
  public.non_distributed_partitioned_table | a                | public.non_distributed_partitioned_table_1 | 0          | 10
+ "schema-test"                            | time             | "schema-test_2009"                         | 01-01-2009 | 01-01-2010
(6 rows)

-- create the same partition to verify it behaves like in plain PG
CREATE TABLE partitioning_test_2011 PARTITION OF partitioning_test FOR VALUES FROM ('2011-01-01') TO ('2012-01-01');
ERROR:  relation "partitioning_test_2011" already exists
CREATE TABLE IF NOT EXISTS partitioning_test_2011 PARTITION OF partitioning_test FOR VALUES FROM ('2011-01-01') TO ('2012-01-01');
NOTICE:  relation "partitioning_test_2011" already exists, skipping
-- verify we can create a partition that doesn't already exist with IF NOT EXISTS
CREATE TABLE IF NOT EXISTS partitioning_test_2013 PARTITION OF partitioning_test FOR VALUES FROM ('2013-01-01') TO ('2014-01-01');
SELECT logicalrelid FROM pg_dist_partition WHERE logicalrelid IN ('partitioning_test', 'partitioning_test_2013') ORDER BY 1;
diff -dU10 -w /tmp/citus/src/test/regress/expected/pg13.out /tmp/citus/src/test/regress/results/pg13.out
--- /tmp/citus/src/test/regress/expected/pg13.out.modified  2021-04-28 07:20:28.467500815 +0000
+++ /tmp/citus/src/test/regress/results/pg13.out.modified   2021-04-28 07:20:28.471500862 +0000
@@ -126,22 +126,22 @@
-- test unicode escape
-- insert the word 'data' with unicode escapes
INSERT INTO text_table VALUES(U&'d\0061t\+000061');
-- insert the word слон
INSERT INTO text_table VALUES(U&'\0441\043B\043E\043D');
SELECT * FROM text_table ORDER BY 1;
  name
------
  abc
  äbc
- data
  äbc
+ data
  слон
(5 rows)

-- Test that we don't propagate base types
CREATE TYPE myvarchar;
CREATE FUNCTION myvarcharin(cstring, oid, integer) RETURNS myvarchar
LANGUAGE internal IMMUTABLE PARALLEL SAFE STRICT AS 'varcharin';
NOTICE:  return type myvarchar is only a shell
CREATE FUNCTION myvarcharout(myvarchar) RETURNS cstring
LANGUAGE internal IMMUTABLE PARALLEL SAFE STRICT AS 'varcharout';
diff -dU10 -w /tmp/citus/src/test/regress/expected/alter_distributed_table.out /tmp/citus/src/test/regress/results/alter_distributed_table.out
--- /tmp/citus/src/test/regress/expected/alter_distributed_table.out.modified   2021-04-28 07:21:30.820217207 +0000
+++ /tmp/citus/src/test/regress/results/alter_distributed_table.out.modified    2021-04-28 07:21:30.832217344 +0000
@@ -125,22 +125,22 @@
--------------------+------------------+---------------------+-------------
  colocation_table   | distributed      | a                   |           4
  colocation_table_2 | distributed      | a                   |           4
  dist_table         | distributed      | b                   |           4
(3 rows)

SELECT STRING_AGG(table_name::text, ', ' ORDER BY 1) AS "Colocation Groups" FROM public.citus_tables
    WHERE table_name IN ('dist_table', 'colocation_table', 'colocation_table_2') GROUP BY colocation_id ORDER BY 1;
      Colocation Groups
------------------------------
- colocation_table, dist_table
  colocation_table_2
+ colocation_table, dist_table
(2 rows)

-- test altering shard count with cascading, note that the colocation will be kept
SELECT alter_distributed_table('dist_table', shard_count := 8, cascade_to_colocated := true);
NOTICE:  creating a new table for alter_distributed_table.dist_table
NOTICE:  moving the data of alter_distributed_table.dist_table
NOTICE:  dropping the old alter_distributed_table.dist_table
NOTICE:  renaming the new table to alter_distributed_table.dist_table
NOTICE:  creating a new table for alter_distributed_table.colocation_table
NOTICE:  moving the data of alter_distributed_table.colocation_table
@@ -157,22 +157,22 @@
--------------------+------------------+---------------------+-------------
  colocation_table   | distributed      | a                   |           8
  colocation_table_2 | distributed      | a                   |           4
  dist_table         | distributed      | b                   |           8
(3 rows)

SELECT STRING_AGG(table_name::text, ', ' ORDER BY 1) AS "Colocation Groups" FROM public.citus_tables
    WHERE table_name IN ('dist_table', 'colocation_table', 'colocation_table_2') GROUP BY colocation_id ORDER BY 1;
      Colocation Groups
------------------------------
- colocation_table, dist_table
  colocation_table_2
+ colocation_table, dist_table
(2 rows)

-- test altering shard count without cascading, note that the colocation will be broken
SELECT alter_distributed_table('dist_table', shard_count := 10, cascade_to_colocated := false);
NOTICE:  creating a new table for alter_distributed_table.dist_table
NOTICE:  moving the data of alter_distributed_table.dist_table
NOTICE:  dropping the old alter_distributed_table.dist_table
NOTICE:  renaming the new table to alter_distributed_table.dist_table
  alter_distributed_table
-------------------------
hanefi commented 3 years ago

There are 2 separate issues here.

  1. We have a small issue with our make file scripts that make check depends on make install and even if you run make install-all the downgrade scripts gets deleted before a clean install and this makes multi_extension test to fail. I have an open PR that fixes this problem #4717 . I will try to merge it today.

  2. PG13.1 and later versions create a different output on queries with ORDER BY clauses. We do not have a remedy for this issue yet, and the tests will start to pass if you can use an earlier version of PostgreSQL. If you check the failing tests, they are all there because of differing ordering methods.

hanefi commented 3 years ago

As it turns out, I am partially mistaken in my earlier explanation. PG13.1 is responsible for some changes in error messages, but the ordering seems to be a different issue.

SaitTalhaNisanci commented 3 years ago

@joelonsql, what is the output of in a psql session?:

SHOW lc_collate;