Parsed test spec with 2 sessions

starting permutation: s1-begin s1-add-node-2 s2-create-table-1 s1-commit s1-show-placements s2-select
node_name|node_port
---------------------------------------------------------------------
localhost|    57637
(1 row)

step s1-begin:
	BEGIN;

step s1-add-node-2:
	SELECT 1 FROM master_add_node('localhost', 57638);

?column?
---------------------------------------------------------------------
       1
(1 row)

step s2-create-table-1:
	SET citus.shard_count TO 4;
	SET citus.shard_replication_factor TO 1;
	CREATE TABLE dist_table (x int, y int);
	SELECT create_distributed_table('dist_table', 'x');
 <waiting ...>
step s1-commit: 
	COMMIT;

step s2-create-table-1: <... completed>
create_distributed_table
---------------------------------------------------------------------

(1 row)

step s1-show-placements:
	SELECT
		nodename, nodeport
	FROM
		pg_dist_shard_placement JOIN pg_dist_shard USING (shardid)
	WHERE
		logicalrelid = 'dist_table'::regclass
	ORDER BY
		nodename, nodeport;

nodename |nodeport
---------------------------------------------------------------------
localhost|   57637
localhost|   57637
localhost|   57638
localhost|   57638
(4 rows)

step s2-select:
	SELECT * FROM dist_table;

x|y
---------------------------------------------------------------------
(0 rows)

master_remove_node
---------------------------------------------------------------------


(2 rows)


starting permutation: s1-begin s1-add-node-2 s2-create-table-1 s1-abort s1-show-placements s2-select
node_name|node_port
---------------------------------------------------------------------
localhost|    57637
(1 row)

step s1-begin:
	BEGIN;

step s1-add-node-2:
	SELECT 1 FROM master_add_node('localhost', 57638);

?column?
---------------------------------------------------------------------
       1
(1 row)

step s2-create-table-1:
	SET citus.shard_count TO 4;
	SET citus.shard_replication_factor TO 1;
	CREATE TABLE dist_table (x int, y int);
	SELECT create_distributed_table('dist_table', 'x');
 <waiting ...>
step s1-abort: 
	ABORT;

step s2-create-table-1: <... completed>
create_distributed_table
---------------------------------------------------------------------

(1 row)

step s1-show-placements:
	SELECT
		nodename, nodeport
	FROM
		pg_dist_shard_placement JOIN pg_dist_shard USING (shardid)
	WHERE
		logicalrelid = 'dist_table'::regclass
	ORDER BY
		nodename, nodeport;

nodename |nodeport
---------------------------------------------------------------------
localhost|   57637
localhost|   57637
localhost|   57637
localhost|   57637
(4 rows)

step s2-select:
	SELECT * FROM dist_table;

x|y
---------------------------------------------------------------------
(0 rows)

master_remove_node
---------------------------------------------------------------------

(1 row)


starting permutation: s2-begin s2-create-table-1 s1-add-node-2 s2-commit s1-show-placements s2-select
node_name|node_port
---------------------------------------------------------------------
localhost|    57637
(1 row)

step s2-begin:
	BEGIN;

step s2-create-table-1:
	SET citus.shard_count TO 4;
	SET citus.shard_replication_factor TO 1;
	CREATE TABLE dist_table (x int, y int);
	SELECT create_distributed_table('dist_table', 'x');

create_distributed_table
---------------------------------------------------------------------

(1 row)

step s1-add-node-2:
	SELECT 1 FROM master_add_node('localhost', 57638);
 <waiting ...>
step s2-commit: 
	COMMIT;

step s1-add-node-2: <... completed>
?column?
---------------------------------------------------------------------
       1
(1 row)

step s1-show-placements:
	SELECT
		nodename, nodeport
	FROM
		pg_dist_shard_placement JOIN pg_dist_shard USING (shardid)
	WHERE
		logicalrelid = 'dist_table'::regclass
	ORDER BY
		nodename, nodeport;

nodename |nodeport
---------------------------------------------------------------------
localhost|   57637
localhost|   57637
localhost|   57637
localhost|   57637
(4 rows)

step s2-select:
	SELECT * FROM dist_table;

x|y
---------------------------------------------------------------------
(0 rows)

master_remove_node
---------------------------------------------------------------------


(2 rows)


starting permutation: s1-add-node-2 s1-begin s1-remove-node-2 s2-create-table-1 s1-commit s1-show-placements s2-select
node_name|node_port
---------------------------------------------------------------------
localhost|    57637
(1 row)

step s1-add-node-2:
	SELECT 1 FROM master_add_node('localhost', 57638);

?column?
---------------------------------------------------------------------
       1
(1 row)

step s1-begin:
	BEGIN;

step s1-remove-node-2:
	SELECT * FROM master_remove_node('localhost', 57638);

master_remove_node
---------------------------------------------------------------------

(1 row)

step s2-create-table-1:
	SET citus.shard_count TO 4;
	SET citus.shard_replication_factor TO 1;
	CREATE TABLE dist_table (x int, y int);
	SELECT create_distributed_table('dist_table', 'x');
 <waiting ...>
step s1-commit: 
	COMMIT;

step s2-create-table-1: <... completed>
create_distributed_table
---------------------------------------------------------------------

(1 row)

step s1-show-placements:
	SELECT
		nodename, nodeport
	FROM
		pg_dist_shard_placement JOIN pg_dist_shard USING (shardid)
	WHERE
		logicalrelid = 'dist_table'::regclass
	ORDER BY
		nodename, nodeport;

nodename |nodeport
---------------------------------------------------------------------
localhost|   57637
localhost|   57637
localhost|   57637
localhost|   57637
(4 rows)

step s2-select:
	SELECT * FROM dist_table;

x|y
---------------------------------------------------------------------
(0 rows)

master_remove_node
---------------------------------------------------------------------

(1 row)


starting permutation: s1-add-node-2 s1-begin s1-remove-node-2 s2-create-table-1 s1-abort s1-show-placements s2-select
node_name|node_port
---------------------------------------------------------------------
localhost|    57637
(1 row)

step s1-add-node-2:
	SELECT 1 FROM master_add_node('localhost', 57638);

?column?
---------------------------------------------------------------------
       1
(1 row)

step s1-begin:
	BEGIN;

step s1-remove-node-2:
	SELECT * FROM master_remove_node('localhost', 57638);

master_remove_node
---------------------------------------------------------------------

(1 row)

step s2-create-table-1:
	SET citus.shard_count TO 4;
	SET citus.shard_replication_factor TO 1;
	CREATE TABLE dist_table (x int, y int);
	SELECT create_distributed_table('dist_table', 'x');
 <waiting ...>
step s1-abort: 
	ABORT;

step s2-create-table-1: <... completed>
create_distributed_table
---------------------------------------------------------------------

(1 row)

step s1-show-placements:
	SELECT
		nodename, nodeport
	FROM
		pg_dist_shard_placement JOIN pg_dist_shard USING (shardid)
	WHERE
		logicalrelid = 'dist_table'::regclass
	ORDER BY
		nodename, nodeport;

nodename |nodeport
---------------------------------------------------------------------
localhost|   57637
localhost|   57637
localhost|   57638
localhost|   57638
(4 rows)

step s2-select:
	SELECT * FROM dist_table;

x|y
---------------------------------------------------------------------
(0 rows)

master_remove_node
---------------------------------------------------------------------


(2 rows)


starting permutation: s1-add-node-2 s2-begin s2-create-table-1 s1-remove-node-2 s2-commit s1-show-placements s2-select
node_name|node_port
---------------------------------------------------------------------
localhost|    57637
(1 row)

step s1-add-node-2:
	SELECT 1 FROM master_add_node('localhost', 57638);

?column?
---------------------------------------------------------------------
       1
(1 row)

step s2-begin:
	BEGIN;

step s2-create-table-1:
	SET citus.shard_count TO 4;
	SET citus.shard_replication_factor TO 1;
	CREATE TABLE dist_table (x int, y int);
	SELECT create_distributed_table('dist_table', 'x');

create_distributed_table
---------------------------------------------------------------------

(1 row)

step s1-remove-node-2:
	SELECT * FROM master_remove_node('localhost', 57638);
 <waiting ...>
step s2-commit: 
	COMMIT;

step s1-remove-node-2: <... completed>
ERROR:  cannot remove or disable the node localhost:xxxxx because because it contains the only shard placement for shard xxxxx
step s1-show-placements:
	SELECT
		nodename, nodeport
	FROM
		pg_dist_shard_placement JOIN pg_dist_shard USING (shardid)
	WHERE
		logicalrelid = 'dist_table'::regclass
	ORDER BY
		nodename, nodeport;

nodename |nodeport
---------------------------------------------------------------------
localhost|   57637
localhost|   57637
localhost|   57638
localhost|   57638
(4 rows)

step s2-select:
	SELECT * FROM dist_table;

x|y
---------------------------------------------------------------------
(0 rows)

master_remove_node
---------------------------------------------------------------------


(2 rows)


starting permutation: s1-add-node-2 s1-begin s1-remove-node-2 s2-create-table-2 s1-commit s2-select
node_name|node_port
---------------------------------------------------------------------
localhost|    57637
(1 row)

step s1-add-node-2:
	SELECT 1 FROM master_add_node('localhost', 57638);

?column?
---------------------------------------------------------------------
       1
(1 row)

step s1-begin:
	BEGIN;

step s1-remove-node-2:
	SELECT * FROM master_remove_node('localhost', 57638);

master_remove_node
---------------------------------------------------------------------

(1 row)

step s2-create-table-2:
	SET citus.shard_count TO 4;
	SET citus.shard_replication_factor TO 1;
	CREATE TABLE dist_table (x int, y int);
	SELECT create_distributed_table('dist_table', 'x');
 <waiting ...>
step s1-commit: 
	COMMIT;

step s2-create-table-2: <... completed>
create_distributed_table
---------------------------------------------------------------------

(1 row)

step s2-select:
	SELECT * FROM dist_table;

x|y
---------------------------------------------------------------------
(0 rows)

master_remove_node
---------------------------------------------------------------------

(1 row)


starting permutation: s1-add-node-2 s2-begin s2-create-table-2 s1-remove-node-2 s2-commit s2-select
node_name|node_port
---------------------------------------------------------------------
localhost|    57637
(1 row)

step s1-add-node-2:
	SELECT 1 FROM master_add_node('localhost', 57638);

?column?
---------------------------------------------------------------------
       1
(1 row)

step s2-begin:
	BEGIN;

step s2-create-table-2:
	SET citus.shard_count TO 4;
	SET citus.shard_replication_factor TO 1;
	CREATE TABLE dist_table (x int, y int);
	SELECT create_distributed_table('dist_table', 'x');

create_distributed_table
---------------------------------------------------------------------

(1 row)

step s1-remove-node-2:
	SELECT * FROM master_remove_node('localhost', 57638);
 <waiting ...>
step s2-commit: 
	COMMIT;

step s1-remove-node-2: <... completed>
ERROR:  cannot remove or disable the node localhost:xxxxx because because it contains the only shard placement for shard xxxxx
step s2-select:
	SELECT * FROM dist_table;

x|y
---------------------------------------------------------------------
(0 rows)

master_remove_node
---------------------------------------------------------------------


(2 rows)


starting permutation: s1-add-node-2 s1-begin s1-remove-node-2 s2-create-append-table s1-commit s2-select
node_name|node_port
---------------------------------------------------------------------
localhost|    57637
(1 row)

step s1-add-node-2:
	SELECT 1 FROM master_add_node('localhost', 57638);

?column?
---------------------------------------------------------------------
       1
(1 row)

step s1-begin:
	BEGIN;

step s1-remove-node-2:
	SELECT * FROM master_remove_node('localhost', 57638);

master_remove_node
---------------------------------------------------------------------

(1 row)

step s2-create-append-table:
	SET citus.shard_replication_factor TO 1;
	CREATE TABLE dist_table (x int, y int);
	SELECT create_distributed_table('dist_table', 'x', 'append');
	SELECT 1 FROM master_create_empty_shard('dist_table');
 <waiting ...>
step s1-commit: 
	COMMIT;

step s2-create-append-table: <... completed>
create_distributed_table
---------------------------------------------------------------------

(1 row)

?column?
---------------------------------------------------------------------
       1
(1 row)

step s2-select:
	SELECT * FROM dist_table;

x|y
---------------------------------------------------------------------
(0 rows)

master_remove_node
---------------------------------------------------------------------

(1 row)


starting permutation: s1-add-node-2 s2-begin s2-create-append-table s1-remove-node-2 s2-commit s2-select
node_name|node_port
---------------------------------------------------------------------
localhost|    57637
(1 row)

step s1-add-node-2:
	SELECT 1 FROM master_add_node('localhost', 57638);

?column?
---------------------------------------------------------------------
       1
(1 row)

step s2-begin:
	BEGIN;

step s2-create-append-table:
	SET citus.shard_replication_factor TO 1;
	CREATE TABLE dist_table (x int, y int);
	SELECT create_distributed_table('dist_table', 'x', 'append');
	SELECT 1 FROM master_create_empty_shard('dist_table');

create_distributed_table
---------------------------------------------------------------------

(1 row)

?column?
---------------------------------------------------------------------
       1
(1 row)

step s1-remove-node-2:
	SELECT * FROM master_remove_node('localhost', 57638);
 <waiting ...>
step s2-commit: 
	COMMIT;

step s1-remove-node-2: <... completed>
ERROR:  cannot remove or disable the node localhost:xxxxx because because it contains the only shard placement for shard xxxxx
step s2-select:
	SELECT * FROM dist_table;

x|y
---------------------------------------------------------------------
(0 rows)

master_remove_node
---------------------------------------------------------------------


(2 rows)

