Parsed test spec with 2 sessions

starting permutation: s1-load-cache s2-begin s2-move-placement s1-move-placement s2-commit s2-print-placements
step s1-load-cache:
	COPY test_move_table FROM PROGRAM 'echo "1,1\n2,2\n3,3\n4,4\n5,5"' WITH CSV;

step s2-begin:
	BEGIN;

step s2-move-placement:
	SELECT master_move_shard_placement((SELECT * FROM selected_shard_for_test_table), 'localhost', 57637, 'localhost', 57638, 'force_logical');

master_move_shard_placement
---------------------------------------------------------------------

(1 row)

step s1-move-placement:
	SELECT master_move_shard_placement((SELECT * FROM selected_shard_for_test_table), 'localhost', 57637, 'localhost', 57638, 'force_logical');

ERROR:  could not acquire the lock required to move public.test_move_table
step s2-commit:
	COMMIT;

step s2-print-placements:
	SELECT
		nodename, nodeport, count(*)
	FROM
		pg_dist_shard_placement
	WHERE
		shardid IN (SELECT shardid FROM pg_dist_shard WHERE logicalrelid = 'test_move_table'::regclass)
	AND
		shardstate = 1
	GROUP BY
		nodename, nodeport;

nodename |nodeport|count
---------------------------------------------------------------------
localhost|   57638|    2
(1 row)


starting permutation: s2-begin s2-move-placement s1-move-placement s2-commit s2-print-placements
step s2-begin:
	BEGIN;

step s2-move-placement:
	SELECT master_move_shard_placement((SELECT * FROM selected_shard_for_test_table), 'localhost', 57637, 'localhost', 57638, 'force_logical');

master_move_shard_placement
---------------------------------------------------------------------

(1 row)

step s1-move-placement:
	SELECT master_move_shard_placement((SELECT * FROM selected_shard_for_test_table), 'localhost', 57637, 'localhost', 57638, 'force_logical');

ERROR:  could not acquire the lock required to move public.test_move_table
step s2-commit:
	COMMIT;

step s2-print-placements:
	SELECT
		nodename, nodeport, count(*)
	FROM
		pg_dist_shard_placement
	WHERE
		shardid IN (SELECT shardid FROM pg_dist_shard WHERE logicalrelid = 'test_move_table'::regclass)
	AND
		shardstate = 1
	GROUP BY
		nodename, nodeport;

nodename |nodeport|count
---------------------------------------------------------------------
localhost|   57638|    2
(1 row)


starting permutation: s2-print-placements s2-begin s2-select-from-table s1-move-placement s1-move-placement-back s1-wait s2-commit s2-print-placements
step s2-print-placements:
 SELECT
  nodename, nodeport, count(*)
 FROM
  pg_dist_shard_placement
 WHERE
  shardid IN (SELECT shardid FROM pg_dist_shard WHERE logicalrelid = 'test_move_table'::regclass)
 AND
  shardstate = 1
 GROUP BY
  nodename, nodeport;

nodename |nodeport|count
---------------------------------------------------------------------
localhost|   57637|    1
localhost|   57638|    1
(2 rows)

step s2-begin:
 BEGIN;

step s2-select-from-table:
 SELECT * FROM test_move_table WHERE x=5;

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

step s1-move-placement:
 SELECT master_move_shard_placement((SELECT * FROM selected_shard_for_test_table), 'localhost', 57637, 'localhost', 57638, 'force_logical');

master_move_shard_placement
---------------------------------------------------------------------

(1 row)

step s1-move-placement-back:
 SELECT master_move_shard_placement((SELECT * FROM selected_shard_for_test_table), 'localhost', 57638, 'localhost', 57637, 'force_logical');
 <waiting ...>
step s1-move-placement-back: <... completed>
ERROR:  shard move failed as the orphaned shard public.test_move_table_102011 leftover from the previous move could not be cleaned up
step s1-wait:
step s2-commit:
 COMMIT;

step s2-print-placements:
 SELECT
  nodename, nodeport, count(*)
 FROM
  pg_dist_shard_placement
 WHERE
  shardid IN (SELECT shardid FROM pg_dist_shard WHERE logicalrelid = 'test_move_table'::regclass)
 AND
  shardstate = 1
 GROUP BY
  nodename, nodeport;

nodename |nodeport|count
---------------------------------------------------------------------
localhost|   57638|    2
(1 row)

