Merge pull request #6078 from citusdata/bump-pg-versions

pull/6223/head
Hanefi Onaldi 2022-08-22 17:52:56 +03:00 committed by GitHub
commit 28b04dc9f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 131 additions and 138 deletions

View File

@ -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'
@ -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

View File

@ -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

View File

@ -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

View File

@ -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
---------------------------------------------------------------------

View File

@ -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

View File

@ -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
---------------------------------------------------------------------

View File

@ -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

View File

@ -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
---------------------------------------------------------------------

View File

@ -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,

View File

@ -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,

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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);

View File

@ -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();