From 9ec9209fd938fe2a19876a514ae6c851d53b6f92 Mon Sep 17 00:00:00 2001 From: Hanefi Onaldi Date: Thu, 21 Jul 2022 20:22:06 +0300 Subject: [PATCH 1/4] Bump PG versions in CI configs --- .circleci/config.yml | 8 +- CONTRIBUTING.md | 11 ++ .../isolation_ref2ref_foreign_keys.out | 126 +++++++++++++----- .../spec/isolation_ref2ref_foreign_keys.spec | 3 + 4 files changed, 108 insertions(+), 40 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 07953f2ab..053d3d76b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,16 +6,16 @@ orbs: parameters: image_suffix: type: string - default: '-vb4dd087' + default: '-v643b0b7' pg13_version: type: string - default: '13.4' + default: '13.8' pg14_version: type: string - default: '14.0' + default: '14.5' upgrade_pg_versions: type: string - default: '13.4-14.0-15beta3' + default: '13.8-14.5-15beta3' style_checker_tools_version: type: string default: '0.8.18' diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7253c92ed..6c54e9d6c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,6 +13,17 @@ why we ask this as well as instructions for how to proceed, see the ### Getting and building +[PostgreSQL documentation](https://www.postgresql.org/support/versioning/) has a +section on upgrade policy. + + We always recommend that all users run the latest available minor release [for PostgreSQL] for whatever major version is in use. + +We expect Citus users to honor this recommendation and use latest available +PostgreSQL minor release. Failure to do so may result in failures in our test +suite. There are some known improvements in PG test architecture such as +[this commit](https://github.com/postgres/postgres/commit/3f323956128ff8589ce4d3a14e8b950837831803) +that are missing in earlier minor versions. + #### Mac 1. Install Xcode diff --git a/src/test/regress/expected/isolation_ref2ref_foreign_keys.out b/src/test/regress/expected/isolation_ref2ref_foreign_keys.out index 246d45aba..e3fec3d04 100644 --- a/src/test/regress/expected/isolation_ref2ref_foreign_keys.out +++ b/src/test/regress/expected/isolation_ref2ref_foreign_keys.out @@ -11,6 +11,9 @@ step s1-begin: BEGIN; step s1-view-locks: + -- The following output changed in PG versions 13.6 and 14.2. The output is expected + -- to change in earlier versions of PG as the and application_name format did not use + -- to include session name at the end. SELECT classid, objid, objsubid, @@ -25,10 +28,10 @@ step s1-view-locks: AND application_name <> 'Citus Maintenance Daemon' ORDER BY 1, 2, 3, 4; -classid| objid|objsubid|mode |application_name |backend_type |query +classid| objid|objsubid|mode |application_name |backend_type |query --------------------------------------------------------------------- - 0|8429800| 4|ShareLock |isolation/isolation_ref2ref_foreign_keys|client backend| UPDATE ref_table_1 SET id = 2 WHERE id = 1; - 0|8429800| 5|ExclusiveLock|isolation/isolation_ref2ref_foreign_keys|client backend| UPDATE ref_table_1 SET id = 2 WHERE id = 1; + 0|8429800| 4|ShareLock |isolation/isolation_ref2ref_foreign_keys/s2|client backend| UPDATE ref_table_1 SET id = 2 WHERE id = 1; + 0|8429800| 5|ExclusiveLock|isolation/isolation_ref2ref_foreign_keys/s2|client backend| UPDATE ref_table_1 SET id = 2 WHERE id = 1; (2 rows) step s1-rollback: @@ -38,6 +41,9 @@ step s2-rollback: ROLLBACK; step s1-view-locks: + -- The following output changed in PG versions 13.6 and 14.2. The output is expected + -- to change in earlier versions of PG as the and application_name format did not use + -- to include session name at the end. SELECT classid, objid, objsubid, @@ -65,6 +71,9 @@ step s2-delete-table-1: DELETE FROM ref_table_1 WHERE id = 1; step s1-view-locks: + -- The following output changed in PG versions 13.6 and 14.2. The output is expected + -- to change in earlier versions of PG as the and application_name format did not use + -- to include session name at the end. SELECT classid, objid, objsubid, @@ -79,16 +88,19 @@ step s1-view-locks: AND application_name <> 'Citus Maintenance Daemon' ORDER BY 1, 2, 3, 4; -classid| objid|objsubid|mode |application_name |backend_type |query +classid| objid|objsubid|mode |application_name |backend_type |query --------------------------------------------------------------------- - 0|8429800| 4|ShareLock |isolation/isolation_ref2ref_foreign_keys|client backend| DELETE FROM ref_table_1 WHERE id = 1; - 0|8429800| 5|ExclusiveLock|isolation/isolation_ref2ref_foreign_keys|client backend| DELETE FROM ref_table_1 WHERE id = 1; + 0|8429800| 4|ShareLock |isolation/isolation_ref2ref_foreign_keys/s2|client backend| DELETE FROM ref_table_1 WHERE id = 1; + 0|8429800| 5|ExclusiveLock|isolation/isolation_ref2ref_foreign_keys/s2|client backend| DELETE FROM ref_table_1 WHERE id = 1; (2 rows) step s2-rollback: ROLLBACK; step s1-view-locks: + -- The following output changed in PG versions 13.6 and 14.2. The output is expected + -- to change in earlier versions of PG as the and application_name format did not use + -- to include session name at the end. SELECT classid, objid, objsubid, @@ -116,6 +128,9 @@ step s2-update-table-2: UPDATE ref_table_2 SET id = 2 WHERE id = 1; step s1-view-locks: + -- The following output changed in PG versions 13.6 and 14.2. The output is expected + -- to change in earlier versions of PG as the and application_name format did not use + -- to include session name at the end. SELECT classid, objid, objsubid, @@ -130,17 +145,20 @@ step s1-view-locks: AND application_name <> 'Citus Maintenance Daemon' ORDER BY 1, 2, 3, 4; -classid| objid|objsubid|mode |application_name |backend_type |query +classid| objid|objsubid|mode |application_name |backend_type |query --------------------------------------------------------------------- - 0|8429800| 5|ExclusiveLock|isolation/isolation_ref2ref_foreign_keys|client backend| UPDATE ref_table_2 SET id = 2 WHERE id = 1; - 0|8429801| 4|ShareLock |isolation/isolation_ref2ref_foreign_keys|client backend| UPDATE ref_table_2 SET id = 2 WHERE id = 1; - 0|8429801| 5|ExclusiveLock|isolation/isolation_ref2ref_foreign_keys|client backend| UPDATE ref_table_2 SET id = 2 WHERE id = 1; + 0|8429800| 5|ExclusiveLock|isolation/isolation_ref2ref_foreign_keys/s2|client backend| UPDATE ref_table_2 SET id = 2 WHERE id = 1; + 0|8429801| 4|ShareLock |isolation/isolation_ref2ref_foreign_keys/s2|client backend| UPDATE ref_table_2 SET id = 2 WHERE id = 1; + 0|8429801| 5|ExclusiveLock|isolation/isolation_ref2ref_foreign_keys/s2|client backend| UPDATE ref_table_2 SET id = 2 WHERE id = 1; (3 rows) step s2-rollback: ROLLBACK; step s1-view-locks: + -- The following output changed in PG versions 13.6 and 14.2. The output is expected + -- to change in earlier versions of PG as the and application_name format did not use + -- to include session name at the end. SELECT classid, objid, objsubid, @@ -168,6 +186,9 @@ step s2-delete-table-2: DELETE FROM ref_table_2 WHERE id = 1; step s1-view-locks: + -- The following output changed in PG versions 13.6 and 14.2. The output is expected + -- to change in earlier versions of PG as the and application_name format did not use + -- to include session name at the end. SELECT classid, objid, objsubid, @@ -182,17 +203,20 @@ step s1-view-locks: AND application_name <> 'Citus Maintenance Daemon' ORDER BY 1, 2, 3, 4; -classid| objid|objsubid|mode |application_name |backend_type |query +classid| objid|objsubid|mode |application_name |backend_type |query --------------------------------------------------------------------- - 0|8429800| 5|ExclusiveLock|isolation/isolation_ref2ref_foreign_keys|client backend| DELETE FROM ref_table_2 WHERE id = 1; - 0|8429801| 4|ShareLock |isolation/isolation_ref2ref_foreign_keys|client backend| DELETE FROM ref_table_2 WHERE id = 1; - 0|8429801| 5|ExclusiveLock|isolation/isolation_ref2ref_foreign_keys|client backend| DELETE FROM ref_table_2 WHERE id = 1; + 0|8429800| 5|ExclusiveLock|isolation/isolation_ref2ref_foreign_keys/s2|client backend| DELETE FROM ref_table_2 WHERE id = 1; + 0|8429801| 4|ShareLock |isolation/isolation_ref2ref_foreign_keys/s2|client backend| DELETE FROM ref_table_2 WHERE id = 1; + 0|8429801| 5|ExclusiveLock|isolation/isolation_ref2ref_foreign_keys/s2|client backend| DELETE FROM ref_table_2 WHERE id = 1; (3 rows) step s2-rollback: ROLLBACK; step s1-view-locks: + -- The following output changed in PG versions 13.6 and 14.2. The output is expected + -- to change in earlier versions of PG as the and application_name format did not use + -- to include session name at the end. SELECT classid, objid, objsubid, @@ -223,6 +247,9 @@ step s1-begin: BEGIN; step s1-view-locks: + -- The following output changed in PG versions 13.6 and 14.2. The output is expected + -- to change in earlier versions of PG as the and application_name format did not use + -- to include session name at the end. SELECT classid, objid, objsubid, @@ -237,12 +264,12 @@ step s1-view-locks: AND application_name <> 'Citus Maintenance Daemon' ORDER BY 1, 2, 3, 4; -classid| objid|objsubid|mode |application_name |backend_type |query +classid| objid|objsubid|mode |application_name |backend_type |query --------------------------------------------------------------------- - 0|8429800| 5|ExclusiveLock|isolation/isolation_ref2ref_foreign_keys|client backend| UPDATE ref_table_3 SET id = 2 WHERE id = 1; - 0|8429801| 5|ExclusiveLock|isolation/isolation_ref2ref_foreign_keys|client backend| UPDATE ref_table_3 SET id = 2 WHERE id = 1; - 0|8429802| 4|ShareLock |isolation/isolation_ref2ref_foreign_keys|client backend| UPDATE ref_table_3 SET id = 2 WHERE id = 1; - 0|8429802| 5|ExclusiveLock|isolation/isolation_ref2ref_foreign_keys|client backend| UPDATE ref_table_3 SET id = 2 WHERE id = 1; + 0|8429800| 5|ExclusiveLock|isolation/isolation_ref2ref_foreign_keys/s2|client backend| UPDATE ref_table_3 SET id = 2 WHERE id = 1; + 0|8429801| 5|ExclusiveLock|isolation/isolation_ref2ref_foreign_keys/s2|client backend| UPDATE ref_table_3 SET id = 2 WHERE id = 1; + 0|8429802| 4|ShareLock |isolation/isolation_ref2ref_foreign_keys/s2|client backend| UPDATE ref_table_3 SET id = 2 WHERE id = 1; + 0|8429802| 5|ExclusiveLock|isolation/isolation_ref2ref_foreign_keys/s2|client backend| UPDATE ref_table_3 SET id = 2 WHERE id = 1; (4 rows) step s1-rollback: @@ -252,6 +279,9 @@ step s2-rollback: ROLLBACK; step s1-view-locks: + -- The following output changed in PG versions 13.6 and 14.2. The output is expected + -- to change in earlier versions of PG as the and application_name format did not use + -- to include session name at the end. SELECT classid, objid, objsubid, @@ -282,6 +312,9 @@ step s1-begin: BEGIN; step s1-view-locks: + -- The following output changed in PG versions 13.6 and 14.2. The output is expected + -- to change in earlier versions of PG as the and application_name format did not use + -- to include session name at the end. SELECT classid, objid, objsubid, @@ -296,12 +329,12 @@ step s1-view-locks: AND application_name <> 'Citus Maintenance Daemon' ORDER BY 1, 2, 3, 4; -classid| objid|objsubid|mode |application_name |backend_type |query +classid| objid|objsubid|mode |application_name |backend_type |query --------------------------------------------------------------------- - 0|8429800| 5|ExclusiveLock|isolation/isolation_ref2ref_foreign_keys|client backend| DELETE FROM ref_table_3 WHERE id = 1; - 0|8429801| 5|ExclusiveLock|isolation/isolation_ref2ref_foreign_keys|client backend| DELETE FROM ref_table_3 WHERE id = 1; - 0|8429802| 4|ShareLock |isolation/isolation_ref2ref_foreign_keys|client backend| DELETE FROM ref_table_3 WHERE id = 1; - 0|8429802| 5|ExclusiveLock|isolation/isolation_ref2ref_foreign_keys|client backend| DELETE FROM ref_table_3 WHERE id = 1; + 0|8429800| 5|ExclusiveLock|isolation/isolation_ref2ref_foreign_keys/s2|client backend| DELETE FROM ref_table_3 WHERE id = 1; + 0|8429801| 5|ExclusiveLock|isolation/isolation_ref2ref_foreign_keys/s2|client backend| DELETE FROM ref_table_3 WHERE id = 1; + 0|8429802| 4|ShareLock |isolation/isolation_ref2ref_foreign_keys/s2|client backend| DELETE FROM ref_table_3 WHERE id = 1; + 0|8429802| 5|ExclusiveLock|isolation/isolation_ref2ref_foreign_keys/s2|client backend| DELETE FROM ref_table_3 WHERE id = 1; (4 rows) step s1-rollback: @@ -311,6 +344,9 @@ step s2-rollback: ROLLBACK; step s1-view-locks: + -- The following output changed in PG versions 13.6 and 14.2. The output is expected + -- to change in earlier versions of PG as the and application_name format did not use + -- to include session name at the end. SELECT classid, objid, objsubid, @@ -338,6 +374,9 @@ step s2-insert-table-1: INSERT INTO ref_table_1 VALUES (7, 7); step s1-view-locks: + -- The following output changed in PG versions 13.6 and 14.2. The output is expected + -- to change in earlier versions of PG as the and application_name format did not use + -- to include session name at the end. SELECT classid, objid, objsubid, @@ -352,16 +391,19 @@ step s1-view-locks: AND application_name <> 'Citus Maintenance Daemon' ORDER BY 1, 2, 3, 4; -classid| objid|objsubid|mode |application_name |backend_type |query +classid| objid|objsubid|mode |application_name |backend_type |query --------------------------------------------------------------------- - 0|8429800| 4|ShareLock |isolation/isolation_ref2ref_foreign_keys|client backend| INSERT INTO ref_table_1 VALUES (7, 7); - 0|8429800| 5|RowExclusiveLock|isolation/isolation_ref2ref_foreign_keys|client backend| INSERT INTO ref_table_1 VALUES (7, 7); + 0|8429800| 4|ShareLock |isolation/isolation_ref2ref_foreign_keys/s2|client backend| INSERT INTO ref_table_1 VALUES (7, 7); + 0|8429800| 5|RowExclusiveLock|isolation/isolation_ref2ref_foreign_keys/s2|client backend| INSERT INTO ref_table_1 VALUES (7, 7); (2 rows) step s2-rollback: ROLLBACK; step s1-view-locks: + -- The following output changed in PG versions 13.6 and 14.2. The output is expected + -- to change in earlier versions of PG as the and application_name format did not use + -- to include session name at the end. SELECT classid, objid, objsubid, @@ -389,6 +431,9 @@ step s2-insert-table-2: INSERT INTO ref_table_2 VALUES (7, 5); step s1-view-locks: + -- The following output changed in PG versions 13.6 and 14.2. The output is expected + -- to change in earlier versions of PG as the and application_name format did not use + -- to include session name at the end. SELECT classid, objid, objsubid, @@ -403,17 +448,20 @@ step s1-view-locks: AND application_name <> 'Citus Maintenance Daemon' ORDER BY 1, 2, 3, 4; -classid| objid|objsubid|mode |application_name |backend_type |query +classid| objid|objsubid|mode |application_name |backend_type |query --------------------------------------------------------------------- - 0|8429800| 5|RowExclusiveLock|isolation/isolation_ref2ref_foreign_keys|client backend| INSERT INTO ref_table_2 VALUES (7, 5); - 0|8429801| 4|ShareLock |isolation/isolation_ref2ref_foreign_keys|client backend| INSERT INTO ref_table_2 VALUES (7, 5); - 0|8429801| 5|RowExclusiveLock|isolation/isolation_ref2ref_foreign_keys|client backend| INSERT INTO ref_table_2 VALUES (7, 5); + 0|8429800| 5|RowExclusiveLock|isolation/isolation_ref2ref_foreign_keys/s2|client backend| INSERT INTO ref_table_2 VALUES (7, 5); + 0|8429801| 4|ShareLock |isolation/isolation_ref2ref_foreign_keys/s2|client backend| INSERT INTO ref_table_2 VALUES (7, 5); + 0|8429801| 5|RowExclusiveLock|isolation/isolation_ref2ref_foreign_keys/s2|client backend| INSERT INTO ref_table_2 VALUES (7, 5); (3 rows) step s2-rollback: ROLLBACK; step s1-view-locks: + -- The following output changed in PG versions 13.6 and 14.2. The output is expected + -- to change in earlier versions of PG as the and application_name format did not use + -- to include session name at the end. SELECT classid, objid, objsubid, @@ -441,6 +489,9 @@ step s2-insert-table-3: INSERT INTO ref_table_3 VALUES (7, 5); step s1-view-locks: + -- The following output changed in PG versions 13.6 and 14.2. The output is expected + -- to change in earlier versions of PG as the and application_name format did not use + -- to include session name at the end. SELECT classid, objid, objsubid, @@ -455,18 +506,21 @@ step s1-view-locks: AND application_name <> 'Citus Maintenance Daemon' ORDER BY 1, 2, 3, 4; -classid| objid|objsubid|mode |application_name |backend_type |query +classid| objid|objsubid|mode |application_name |backend_type |query --------------------------------------------------------------------- - 0|8429800| 5|RowExclusiveLock|isolation/isolation_ref2ref_foreign_keys|client backend| INSERT INTO ref_table_3 VALUES (7, 5); - 0|8429801| 5|RowExclusiveLock|isolation/isolation_ref2ref_foreign_keys|client backend| INSERT INTO ref_table_3 VALUES (7, 5); - 0|8429802| 4|ShareLock |isolation/isolation_ref2ref_foreign_keys|client backend| INSERT INTO ref_table_3 VALUES (7, 5); - 0|8429802| 5|RowExclusiveLock|isolation/isolation_ref2ref_foreign_keys|client backend| INSERT INTO ref_table_3 VALUES (7, 5); + 0|8429800| 5|RowExclusiveLock|isolation/isolation_ref2ref_foreign_keys/s2|client backend| INSERT INTO ref_table_3 VALUES (7, 5); + 0|8429801| 5|RowExclusiveLock|isolation/isolation_ref2ref_foreign_keys/s2|client backend| INSERT INTO ref_table_3 VALUES (7, 5); + 0|8429802| 4|ShareLock |isolation/isolation_ref2ref_foreign_keys/s2|client backend| INSERT INTO ref_table_3 VALUES (7, 5); + 0|8429802| 5|RowExclusiveLock|isolation/isolation_ref2ref_foreign_keys/s2|client backend| INSERT INTO ref_table_3 VALUES (7, 5); (4 rows) step s2-rollback: ROLLBACK; step s1-view-locks: + -- The following output changed in PG versions 13.6 and 14.2. The output is expected + -- to change in earlier versions of PG as the and application_name format did not use + -- to include session name at the end. SELECT classid, objid, objsubid, diff --git a/src/test/regress/spec/isolation_ref2ref_foreign_keys.spec b/src/test/regress/spec/isolation_ref2ref_foreign_keys.spec index 3b7e81673..4967883c0 100644 --- a/src/test/regress/spec/isolation_ref2ref_foreign_keys.spec +++ b/src/test/regress/spec/isolation_ref2ref_foreign_keys.spec @@ -74,6 +74,9 @@ step "s1-select-table-3" step "s1-view-locks" { + -- The following output changed in PG versions 13.6 and 14.2. The output is expected + -- to change in earlier versions of PG as the and application_name format did not use + -- to include session name at the end. SELECT classid, objid, objsubid, From e33ba7da9e750824c9bd8dc3b3c137af3143e99b Mon Sep 17 00:00:00 2001 From: Hanefi Onaldi Date: Thu, 18 Aug 2022 23:21:12 +0300 Subject: [PATCH 2/4] Decrease min messages for normalization --- src/test/regress/expected/failure_ddl.out | 13 +--- .../regress/expected/failure_multi_dml.out | 7 +-- .../regress/expected/failure_savepoints.out | 59 +------------------ .../regress/expected/failure_truncate.out | 13 +--- src/test/regress/expected/failure_vacuum.out | 7 +-- src/test/regress/sql/failure_ddl.sql | 4 +- src/test/regress/sql/failure_multi_dml.sql | 3 + src/test/regress/sql/failure_savepoints.sql | 2 + src/test/regress/sql/failure_truncate.sql | 3 +- src/test/regress/sql/failure_vacuum.sql | 2 + 10 files changed, 17 insertions(+), 96 deletions(-) diff --git a/src/test/regress/expected/failure_ddl.out b/src/test/regress/expected/failure_ddl.out index 9658c9346..77b134a72 100644 --- a/src/test/regress/expected/failure_ddl.out +++ b/src/test/regress/expected/failure_ddl.out @@ -180,7 +180,7 @@ ALTER TABLE test_table DROP COLUMN new_column; -- but now kill just after the worker sends response to -- COMMIT command, so we'll have lots of warnings but the command -- should have been committed both on the distributed table and the placements -SET client_min_messages TO WARNING; +SET client_min_messages TO ERROR; SELECT citus.mitmproxy('conn.onCommandComplete(command="^COMMIT").kill()'); mitmproxy --------------------------------------------------------------------- @@ -188,23 +188,12 @@ SELECT citus.mitmproxy('conn.onCommandComplete(command="^COMMIT").kill()'); (1 row) ALTER TABLE test_table ADD COLUMN new_column INT; -WARNING: connection not open -CONTEXT: while executing command on localhost:xxxxx -WARNING: failed to commit transaction on localhost:xxxxx -WARNING: connection not open -CONTEXT: while executing command on localhost:xxxxx -WARNING: connection not open -CONTEXT: while executing command on localhost:xxxxx -WARNING: failed to commit transaction on localhost:xxxxx -WARNING: connection not open -CONTEXT: while executing command on localhost:xxxxx SELECT citus.mitmproxy('conn.allow()'); mitmproxy --------------------------------------------------------------------- (1 row) -SET client_min_messages TO ERROR; SELECT array_agg(name::text ORDER BY name::text) FROM public.table_attrs where relid = 'test_table'::regclass; array_agg --------------------------------------------------------------------- diff --git a/src/test/regress/expected/failure_multi_dml.out b/src/test/regress/expected/failure_multi_dml.out index eb336894f..7ca8a8f91 100644 --- a/src/test/regress/expected/failure_multi_dml.out +++ b/src/test/regress/expected/failure_multi_dml.out @@ -378,6 +378,7 @@ SELECT citus.mitmproxy('conn.onQuery(query="^COMMIT").kill()'); (1 row) +SET client_min_messages TO ERROR; BEGIN; DELETE FROM dml_test WHERE id = 1; DELETE FROM dml_test WHERE id = 2; @@ -385,11 +386,7 @@ INSERT INTO dml_test VALUES (5, 'Epsilon'); UPDATE dml_test SET name = 'alpha' WHERE id = 1; UPDATE dml_test SET name = 'gamma' WHERE id = 3; COMMIT; -WARNING: connection not open -CONTEXT: while executing command on localhost:xxxxx -WARNING: failed to commit transaction on localhost:xxxxx -WARNING: connection not open -CONTEXT: while executing command on localhost:xxxxx +RESET client_min_messages; -- all changes should be committed because we injected -- the failure on the COMMIT time. And, we should not -- mark any placements as INVALID diff --git a/src/test/regress/expected/failure_savepoints.out b/src/test/regress/expected/failure_savepoints.out index 697b5b190..9b155e90e 100644 --- a/src/test/regress/expected/failure_savepoints.out +++ b/src/test/regress/expected/failure_savepoints.out @@ -10,6 +10,7 @@ SELECT citus.mitmproxy('conn.allow()'); SET citus.shard_count = 2; SET citus.shard_replication_factor = 1; -- one shard per worker SET citus.next_shard_id TO 100950; +SET client_min_messages TO ERROR; ALTER SEQUENCE pg_catalog.pg_dist_placement_placementid_seq RESTART 150; CREATE TABLE artists ( id bigint NOT NULL, @@ -36,13 +37,6 @@ SELECT citus.mitmproxy('conn.onQuery(query="^SAVEPOINT").kill()'); BEGIN; INSERT INTO artists VALUES (5, 'Asher Lev'); SAVEPOINT s1; -WARNING: connection not open -CONTEXT: while executing command on localhost:xxxxx -WARNING: connection to the remote node localhost:xxxxx failed with the following error: connection not open -WARNING: connection not open -CONTEXT: while executing command on localhost:xxxxx -WARNING: connection not open -CONTEXT: while executing command on localhost:xxxxx ERROR: connection not open CONTEXT: while executing command on localhost:xxxxx DELETE FROM artists WHERE id=4; @@ -68,16 +62,6 @@ UPDATE artists SET name='a'; SAVEPOINT s1; DELETE FROM artists WHERE id=4; RELEASE SAVEPOINT s1; -WARNING: AbortSubTransaction while in COMMIT state -WARNING: connection not open -CONTEXT: while executing command on localhost:xxxxx -WARNING: connection to the remote node localhost:xxxxx failed with the following error: connection not open -WARNING: connection not open -CONTEXT: while executing command on localhost:xxxxx -WARNING: connection not open -CONTEXT: while executing command on localhost:xxxxx -WARNING: savepoint "savepoint_2" does not exist -CONTEXT: while executing command on localhost:xxxxx ERROR: connection not open CONTEXT: while executing command on localhost:xxxxx ROLLBACK; @@ -99,10 +83,6 @@ INSERT INTO artists VALUES (5, 'Asher Lev'); SAVEPOINT s1; DELETE FROM artists WHERE id=4; ROLLBACK TO SAVEPOINT s1; -WARNING: connection not open -CONTEXT: while executing command on localhost:xxxxx -WARNING: connection not open -CONTEXT: while executing command on localhost:xxxxx COMMIT; ERROR: failure on connection marked as essential: localhost:xxxxx SELECT * FROM artists WHERE id IN (4, 5); @@ -125,14 +105,6 @@ RELEASE SAVEPOINT s1; SAVEPOINT s2; INSERT INTO artists VALUES (5, 'Jacob Kahn'); RELEASE SAVEPOINT s2; -WARNING: AbortSubTransaction while in COMMIT state -WARNING: connection not open -CONTEXT: while executing command on localhost:xxxxx -WARNING: connection to the remote node localhost:xxxxx failed with the following error: connection not open -WARNING: connection not open -CONTEXT: while executing command on localhost:xxxxx -WARNING: connection not open -CONTEXT: while executing command on localhost:xxxxx ERROR: connection not open CONTEXT: while executing command on localhost:xxxxx COMMIT; @@ -156,10 +128,6 @@ ROLLBACK TO SAVEPOINT s1; SAVEPOINT s2; DELETE FROM artists WHERE id=5; ROLLBACK TO SAVEPOINT s2; -WARNING: connection not open -CONTEXT: while executing command on localhost:xxxxx -WARNING: connection not open -CONTEXT: while executing command on localhost:xxxxx COMMIT; ERROR: failure on connection marked as essential: localhost:xxxxx SELECT * FROM artists WHERE id IN (4, 5); @@ -205,12 +173,6 @@ INSERT INTO artists VALUES (6, 'John J. Audubon'); INSERT INTO artists VALUES (7, 'Emily Carr'); INSERT INTO artists VALUES (7, 'Emily Carr'); ROLLBACK TO SAVEPOINT s1; -WARNING: connection not open -WARNING: connection not open -WARNING: connection not open -WARNING: connection to the remote node localhost:xxxxx failed with the following error: connection not open -WARNING: connection not open -WARNING: connection not open COMMIT; ERROR: failure on connection marked as essential: localhost:xxxxx SELECT * FROM artists WHERE id=6; @@ -242,10 +204,6 @@ SELECT citus.mitmproxy('conn.onQuery(query="^SAVEPOINT").kill()'); BEGIN; INSERT INTO researchers VALUES (7, 4, 'Jan Plaza'); SAVEPOINT s1; -WARNING: connection not open -WARNING: connection to the remote node localhost:xxxxx failed with the following error: connection not open -WARNING: connection not open -WARNING: connection not open ERROR: connection not open INSERT INTO researchers VALUES (8, 4, 'Alonzo Church'); ERROR: current transaction is aborted, commands ignored until end of transaction block @@ -281,8 +239,6 @@ INSERT INTO researchers VALUES (7, 4, 'Jan Plaza'); SAVEPOINT s1; INSERT INTO researchers VALUES (8, 4, 'Alonzo Church'); ROLLBACK TO s1; -WARNING: connection not open -WARNING: connection not open RELEASE SAVEPOINT s1; COMMIT; ERROR: failure on connection marked as essential: localhost:xxxxx @@ -314,12 +270,6 @@ SAVEPOINT s1; INSERT INTO researchers VALUES (8, 4, 'Alonzo Church'); ROLLBACK TO s1; RELEASE SAVEPOINT s1; -WARNING: AbortSubTransaction while in COMMIT state -WARNING: connection not open -WARNING: connection to the remote node localhost:xxxxx failed with the following error: connection not open -WARNING: connection not open -WARNING: connection not open -WARNING: savepoint "savepoint_3" does not exist ERROR: connection not open COMMIT; -- should see correct results from healthy placement and one bad placement @@ -361,16 +311,11 @@ SELECT * FROM ref; (1 row) ROLLBACK TO SAVEPOINT start; -WARNING: connection not open -WARNING: connection not open SELECT * FROM ref; -WARNING: connection not open -WARNING: connection to the remote node localhost:xxxxx failed with the following error: connection not open -WARNING: connection not open -WARNING: connection not open ERROR: connection to the remote node localhost:xxxxx failed with the following error: connection not open END; -- clean up +RESET client_min_messages; SELECT citus.mitmproxy('conn.allow()'); mitmproxy --------------------------------------------------------------------- diff --git a/src/test/regress/expected/failure_truncate.out b/src/test/regress/expected/failure_truncate.out index b0dda6bda..4e332252e 100644 --- a/src/test/regress/expected/failure_truncate.out +++ b/src/test/regress/expected/failure_truncate.out @@ -266,7 +266,7 @@ SELECT count(*) FROM test_table; -- refill the table TRUNCATE test_table; INSERT INTO test_table SELECT x,x FROM generate_series(1,20) as f(x); -SET client_min_messages TO WARNING; +SET client_min_messages TO ERROR; -- now kill just after the worker sends response to -- COMMIT command, so we'll have lots of warnings but the command -- should have been committed both on the distributed table and the placements @@ -277,16 +277,6 @@ SELECT citus.mitmproxy('conn.onCommandComplete(command="^COMMIT").kill()'); (1 row) TRUNCATE test_table; -WARNING: connection not open -CONTEXT: while executing command on localhost:xxxxx -WARNING: failed to commit transaction on localhost:xxxxx -WARNING: connection not open -CONTEXT: while executing command on localhost:xxxxx -WARNING: connection not open -CONTEXT: while executing command on localhost:xxxxx -WARNING: failed to commit transaction on localhost:xxxxx -WARNING: connection not open -CONTEXT: while executing command on localhost:xxxxx SELECT citus.mitmproxy('conn.allow()'); mitmproxy --------------------------------------------------------------------- @@ -305,7 +295,6 @@ SELECT count(*) FROM test_table; 0 (1 row) -SET client_min_messages TO ERROR; INSERT INTO test_table SELECT x,x FROM generate_series(1,20) as f(x); -- now cancel just after the worker sends response to -- but Postgres doesn't accept interrupts during COMMIT and ROLLBACK diff --git a/src/test/regress/expected/failure_vacuum.out b/src/test/regress/expected/failure_vacuum.out index 632562b52..617d40d3a 100644 --- a/src/test/regress/expected/failure_vacuum.out +++ b/src/test/regress/expected/failure_vacuum.out @@ -39,6 +39,7 @@ SELECT citus.mitmproxy('conn.onQuery(query="^ANALYZE").kill()'); ANALYZE vacuum_test; ERROR: connection to the remote node localhost:xxxxx failed with the following error: connection not open +SET client_min_messages TO ERROR; SELECT citus.mitmproxy('conn.onQuery(query="^COMMIT").kill()'); mitmproxy --------------------------------------------------------------------- @@ -46,11 +47,7 @@ SELECT citus.mitmproxy('conn.onQuery(query="^COMMIT").kill()'); (1 row) ANALYZE vacuum_test; -WARNING: connection not open -CONTEXT: while executing command on localhost:xxxxx -WARNING: failed to commit transaction on localhost:xxxxx -WARNING: connection not open -CONTEXT: while executing command on localhost:xxxxx +RESET client_min_messages; SELECT citus.mitmproxy('conn.allow()'); mitmproxy --------------------------------------------------------------------- diff --git a/src/test/regress/sql/failure_ddl.sql b/src/test/regress/sql/failure_ddl.sql index a13d563e0..f63605fa9 100644 --- a/src/test/regress/sql/failure_ddl.sql +++ b/src/test/regress/sql/failure_ddl.sql @@ -89,13 +89,11 @@ ALTER TABLE test_table DROP COLUMN new_column; -- but now kill just after the worker sends response to -- COMMIT command, so we'll have lots of warnings but the command -- should have been committed both on the distributed table and the placements -SET client_min_messages TO WARNING; +SET client_min_messages TO ERROR; SELECT citus.mitmproxy('conn.onCommandComplete(command="^COMMIT").kill()'); ALTER TABLE test_table ADD COLUMN new_column INT; SELECT citus.mitmproxy('conn.allow()'); -SET client_min_messages TO ERROR; - SELECT array_agg(name::text ORDER BY name::text) FROM public.table_attrs where relid = 'test_table'::regclass; SELECT run_command_on_placements('test_table', $$SELECT array_agg(name::text ORDER BY name::text) FROM public.table_attrs where relid = '%s'::regclass;$$) ORDER BY 1; diff --git a/src/test/regress/sql/failure_multi_dml.sql b/src/test/regress/sql/failure_multi_dml.sql index 146c2a8d1..390c01461 100644 --- a/src/test/regress/sql/failure_multi_dml.sql +++ b/src/test/regress/sql/failure_multi_dml.sql @@ -212,6 +212,7 @@ COPY dml_test FROM STDIN WITH CSV; -- fail at PREPARED COMMIT as we use 2PC SELECT citus.mitmproxy('conn.onQuery(query="^COMMIT").kill()'); +SET client_min_messages TO ERROR; BEGIN; DELETE FROM dml_test WHERE id = 1; @@ -221,6 +222,8 @@ UPDATE dml_test SET name = 'alpha' WHERE id = 1; UPDATE dml_test SET name = 'gamma' WHERE id = 3; COMMIT; +RESET client_min_messages; + -- all changes should be committed because we injected -- the failure on the COMMIT time. And, we should not -- mark any placements as INVALID diff --git a/src/test/regress/sql/failure_savepoints.sql b/src/test/regress/sql/failure_savepoints.sql index b586bcb5c..9291989a4 100644 --- a/src/test/regress/sql/failure_savepoints.sql +++ b/src/test/regress/sql/failure_savepoints.sql @@ -7,6 +7,7 @@ SELECT citus.mitmproxy('conn.allow()'); SET citus.shard_count = 2; SET citus.shard_replication_factor = 1; -- one shard per worker SET citus.next_shard_id TO 100950; +SET client_min_messages TO ERROR; ALTER SEQUENCE pg_catalog.pg_dist_placement_placementid_seq RESTART 150; CREATE TABLE artists ( @@ -200,6 +201,7 @@ SELECT * FROM ref; END; -- clean up +RESET client_min_messages; SELECT citus.mitmproxy('conn.allow()'); DROP TABLE artists; DROP TABLE researchers; diff --git a/src/test/regress/sql/failure_truncate.sql b/src/test/regress/sql/failure_truncate.sql index 059a62cd9..c5aad63fc 100644 --- a/src/test/regress/sql/failure_truncate.sql +++ b/src/test/regress/sql/failure_truncate.sql @@ -103,7 +103,7 @@ SELECT count(*) FROM test_table; TRUNCATE test_table; INSERT INTO test_table SELECT x,x FROM generate_series(1,20) as f(x); -SET client_min_messages TO WARNING; +SET client_min_messages TO ERROR; -- now kill just after the worker sends response to -- COMMIT command, so we'll have lots of warnings but the command -- should have been committed both on the distributed table and the placements @@ -112,7 +112,6 @@ TRUNCATE test_table; SELECT citus.mitmproxy('conn.allow()'); SELECT * FROM unhealthy_shard_count; SELECT count(*) FROM test_table; -SET client_min_messages TO ERROR; INSERT INTO test_table SELECT x,x FROM generate_series(1,20) as f(x); diff --git a/src/test/regress/sql/failure_vacuum.sql b/src/test/regress/sql/failure_vacuum.sql index b87b78195..2d79b03d5 100644 --- a/src/test/regress/sql/failure_vacuum.sql +++ b/src/test/regress/sql/failure_vacuum.sql @@ -20,8 +20,10 @@ VACUUM vacuum_test; SELECT citus.mitmproxy('conn.onQuery(query="^ANALYZE").kill()'); ANALYZE vacuum_test; +SET client_min_messages TO ERROR; SELECT citus.mitmproxy('conn.onQuery(query="^COMMIT").kill()'); ANALYZE vacuum_test; +RESET client_min_messages; SELECT citus.mitmproxy('conn.allow()'); SELECT recover_prepared_transactions(); From 616b1758c2b07154e74a6ae51fddf375f62d0172 Mon Sep 17 00:00:00 2001 From: Hanefi Onaldi Date: Wed, 27 Jul 2022 00:43:28 +0300 Subject: [PATCH 3/4] Add more normalization rules --- src/test/regress/bin/normalize.sed | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/regress/bin/normalize.sed b/src/test/regress/bin/normalize.sed index 19bbdaaea..2c95403b9 100644 --- a/src/test/regress/bin/normalize.sed +++ b/src/test/regress/bin/normalize.sed @@ -116,6 +116,12 @@ s/(ERROR: |WARNING: |error:) server closed the connection unexpectedly/\1 connec /^\s*connection not open$/d #endif /* (PG_VERSION_NUM >= PG_VERSION_13) && (PG_VERSION_NUM < PG_VERSION_14) */ +# Changed outputs after minor bump to PG14.5 and PG13.8 +s/(ERROR: |WARNING: |error:) invalid socket/\1 connection not open/g + +# Extra outputs after minor bump to PG14.5 and PG13.8 +/^\s*invalid socket$/d + # intermediate_results s/(ERROR.*)pgsql_job_cache\/([0-9]+_[0-9]+_[0-9]+)\/(.*).data/\1pgsql_job_cache\/xx_x_xxx\/\3.data/g From a570dfead2b693b8548e8dbb51187d6f294283ca Mon Sep 17 00:00:00 2001 From: Hanefi Onaldi Date: Thu, 21 Jul 2022 20:23:52 +0300 Subject: [PATCH 4/4] Remove outdated defaults for PG versions in CI configs --- .circleci/config.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 053d3d76b..50f0e66bc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -114,7 +114,6 @@ jobs: image_tag: description: 'docker image tag to use' type: string - default: 12-13 docker: - image: '<< parameters.image >>:<< parameters.image_tag >><< pipeline.parameters.image_suffix >>' working_directory: /home/circleci/project @@ -195,7 +194,6 @@ jobs: image_tag: description: 'docker image tag to use' type: string - default: 12-13 docker: - image: '<< parameters.image >>:<< parameters.image_tag >><< pipeline.parameters.image_suffix >>' resource_class: xlarge