Parsed test spec with 3 sessions

starting permutation: s3-acquire-advisory-lock s1-begin s1-move-placement s2-insert s3-release-advisory-lock s1-end s1-select s1-get-shard-distribution
step s3-acquire-advisory-lock:
    SELECT pg_advisory_lock(44000, 55152);

pg_advisory_lock
---------------------------------------------------------------------

(1 row)

step s1-begin:
 BEGIN;

step s1-move-placement:
     SELECT master_move_shard_placement(get_shard_id_for_distribution_column, 'localhost', 57637, 'localhost', 57638) FROM selected_shard;
 <waiting ...>
step s2-insert: 
    INSERT INTO logical_replicate_placement VALUES (15, 15), (172, 172);

step s3-release-advisory-lock:
    SELECT pg_advisory_unlock(44000, 55152);

pg_advisory_unlock
---------------------------------------------------------------------
t
(1 row)

step s1-move-placement: <... completed>
master_move_shard_placement
---------------------------------------------------------------------

(1 row)

step s1-end:
 COMMIT;

step s1-select:
  SELECT * FROM logical_replicate_placement order by y;

  x|  y
---------------------------------------------------------------------
 15| 15
172|172
(2 rows)

step s1-get-shard-distribution:
    select nodeport from pg_dist_placement inner join pg_dist_node on(pg_dist_placement.groupid = pg_dist_node.groupid) where shardstate != 4 AND shardid in (SELECT * FROM selected_shard) order by nodeport;

nodeport
---------------------------------------------------------------------
   57638
(1 row)


starting permutation: s3-acquire-advisory-lock s1-begin s1-move-placement s2-upsert s3-release-advisory-lock s1-end s1-select s1-get-shard-distribution
step s3-acquire-advisory-lock:
    SELECT pg_advisory_lock(44000, 55152);

pg_advisory_lock
---------------------------------------------------------------------

(1 row)

step s1-begin:
 BEGIN;

step s1-move-placement:
     SELECT master_move_shard_placement(get_shard_id_for_distribution_column, 'localhost', 57637, 'localhost', 57638) FROM selected_shard;
 <waiting ...>
step s2-upsert: 
    INSERT INTO logical_replicate_placement VALUES (15, 15), (172, 172);
    INSERT INTO logical_replicate_placement VALUES (15, 15), (172, 172) ON CONFLICT (x) DO UPDATE SET y = logical_replicate_placement.y + 1;

step s3-release-advisory-lock:
    SELECT pg_advisory_unlock(44000, 55152);

pg_advisory_unlock
---------------------------------------------------------------------
t
(1 row)

step s1-move-placement: <... completed>
master_move_shard_placement
---------------------------------------------------------------------

(1 row)

step s1-end:
 COMMIT;

step s1-select:
  SELECT * FROM logical_replicate_placement order by y;

  x|  y
---------------------------------------------------------------------
 15| 16
172|173
(2 rows)

step s1-get-shard-distribution:
    select nodeport from pg_dist_placement inner join pg_dist_node on(pg_dist_placement.groupid = pg_dist_node.groupid) where shardstate != 4 AND shardid in (SELECT * FROM selected_shard) order by nodeport;

nodeport
---------------------------------------------------------------------
   57638
(1 row)


starting permutation: s1-insert s3-acquire-advisory-lock s1-begin s1-move-placement s2-update s3-release-advisory-lock s1-end s1-select s1-get-shard-distribution
step s1-insert:
    INSERT INTO logical_replicate_placement VALUES (15, 15), (172, 172);

step s3-acquire-advisory-lock:
    SELECT pg_advisory_lock(44000, 55152);

pg_advisory_lock
---------------------------------------------------------------------

(1 row)

step s1-begin:
 BEGIN;

step s1-move-placement:
     SELECT master_move_shard_placement(get_shard_id_for_distribution_column, 'localhost', 57637, 'localhost', 57638) FROM selected_shard;
 <waiting ...>
step s2-update: 
    UPDATE logical_replicate_placement SET y = y + 1;

step s3-release-advisory-lock:
    SELECT pg_advisory_unlock(44000, 55152);

pg_advisory_unlock
---------------------------------------------------------------------
t
(1 row)

step s1-move-placement: <... completed>
master_move_shard_placement
---------------------------------------------------------------------

(1 row)

step s1-end:
 COMMIT;

step s1-select:
  SELECT * FROM logical_replicate_placement order by y;

  x|  y
---------------------------------------------------------------------
 15| 16
172|173
(2 rows)

step s1-get-shard-distribution:
    select nodeport from pg_dist_placement inner join pg_dist_node on(pg_dist_placement.groupid = pg_dist_node.groupid) where shardstate != 4 AND shardid in (SELECT * FROM selected_shard) order by nodeport;

nodeport
---------------------------------------------------------------------
   57638
(1 row)


starting permutation: s1-insert s3-acquire-advisory-lock s1-begin s1-move-placement s2-delete s3-release-advisory-lock s1-end s1-select s1-get-shard-distribution
step s1-insert:
    INSERT INTO logical_replicate_placement VALUES (15, 15), (172, 172);

step s3-acquire-advisory-lock:
    SELECT pg_advisory_lock(44000, 55152);

pg_advisory_lock
---------------------------------------------------------------------

(1 row)

step s1-begin:
 BEGIN;

step s1-move-placement:
     SELECT master_move_shard_placement(get_shard_id_for_distribution_column, 'localhost', 57637, 'localhost', 57638) FROM selected_shard;
 <waiting ...>
step s2-delete: 
    DELETE FROM logical_replicate_placement;

step s3-release-advisory-lock:
    SELECT pg_advisory_unlock(44000, 55152);

pg_advisory_unlock
---------------------------------------------------------------------
t
(1 row)

step s1-move-placement: <... completed>
master_move_shard_placement
---------------------------------------------------------------------

(1 row)

step s1-end:
 COMMIT;

step s1-select:
  SELECT * FROM logical_replicate_placement order by y;

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

step s1-get-shard-distribution:
    select nodeport from pg_dist_placement inner join pg_dist_node on(pg_dist_placement.groupid = pg_dist_node.groupid) where shardstate != 4 AND shardid in (SELECT * FROM selected_shard) order by nodeport;

nodeport
---------------------------------------------------------------------
   57638
(1 row)


starting permutation: s1-insert s3-acquire-advisory-lock s1-begin s1-move-placement s2-select s3-release-advisory-lock s1-end s1-get-shard-distribution
step s1-insert:
    INSERT INTO logical_replicate_placement VALUES (15, 15), (172, 172);

step s3-acquire-advisory-lock:
    SELECT pg_advisory_lock(44000, 55152);

pg_advisory_lock
---------------------------------------------------------------------

(1 row)

step s1-begin:
 BEGIN;

step s1-move-placement:
     SELECT master_move_shard_placement(get_shard_id_for_distribution_column, 'localhost', 57637, 'localhost', 57638) FROM selected_shard;
 <waiting ...>
step s2-select: 
    SELECT * FROM logical_replicate_placement ORDER BY y;

  x|  y
---------------------------------------------------------------------
 15| 15
172|172
(2 rows)

step s3-release-advisory-lock:
    SELECT pg_advisory_unlock(44000, 55152);

pg_advisory_unlock
---------------------------------------------------------------------
t
(1 row)

step s1-move-placement: <... completed>
master_move_shard_placement
---------------------------------------------------------------------

(1 row)

step s1-end:
 COMMIT;

step s1-get-shard-distribution:
    select nodeport from pg_dist_placement inner join pg_dist_node on(pg_dist_placement.groupid = pg_dist_node.groupid) where shardstate != 4 AND shardid in (SELECT * FROM selected_shard) order by nodeport;

nodeport
---------------------------------------------------------------------
   57638
(1 row)


starting permutation: s3-acquire-advisory-lock s1-begin s1-move-placement s2-copy s3-release-advisory-lock s1-end s1-select s1-get-shard-distribution
step s3-acquire-advisory-lock:
    SELECT pg_advisory_lock(44000, 55152);

pg_advisory_lock
---------------------------------------------------------------------

(1 row)

step s1-begin:
 BEGIN;

step s1-move-placement:
     SELECT master_move_shard_placement(get_shard_id_for_distribution_column, 'localhost', 57637, 'localhost', 57638) FROM selected_shard;
 <waiting ...>
step s2-copy: 
 COPY logical_replicate_placement FROM PROGRAM 'echo "1,1\n2,2\n3,3\n4,4\n5,5\n15,30"' WITH CSV;

step s3-release-advisory-lock:
    SELECT pg_advisory_unlock(44000, 55152);

pg_advisory_unlock
---------------------------------------------------------------------
t
(1 row)

step s1-move-placement: <... completed>
master_move_shard_placement
---------------------------------------------------------------------

(1 row)

step s1-end:
 COMMIT;

step s1-select:
  SELECT * FROM logical_replicate_placement order by y;

 x| y
---------------------------------------------------------------------
 1| 1
 2| 2
 3| 3
 4| 4
 5| 5
15|30
(6 rows)

step s1-get-shard-distribution:
    select nodeport from pg_dist_placement inner join pg_dist_node on(pg_dist_placement.groupid = pg_dist_node.groupid) where shardstate != 4 AND shardid in (SELECT * FROM selected_shard) order by nodeport;

nodeport
---------------------------------------------------------------------
   57638
(1 row)


starting permutation: s1-insert s1-begin s1-move-placement s2-truncate s1-end s1-select s1-get-shard-distribution
step s1-insert:
    INSERT INTO logical_replicate_placement VALUES (15, 15), (172, 172);

step s1-begin:
 BEGIN;

step s1-move-placement:
     SELECT master_move_shard_placement(get_shard_id_for_distribution_column, 'localhost', 57637, 'localhost', 57638) FROM selected_shard;

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

(1 row)

step s2-truncate:
 TRUNCATE logical_replicate_placement;
 <waiting ...>
step s1-end: 
 COMMIT;

step s2-truncate: <... completed>
step s1-select:
  SELECT * FROM logical_replicate_placement order by y;

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

step s1-get-shard-distribution:
    select nodeport from pg_dist_placement inner join pg_dist_node on(pg_dist_placement.groupid = pg_dist_node.groupid) where shardstate != 4 AND shardid in (SELECT * FROM selected_shard) order by nodeport;

nodeport
---------------------------------------------------------------------
   57638
(1 row)


starting permutation: s3-acquire-advisory-lock s1-begin s1-move-placement s2-alter-table s3-release-advisory-lock s1-end s1-select s1-get-shard-distribution
step s3-acquire-advisory-lock:
    SELECT pg_advisory_lock(44000, 55152);

pg_advisory_lock
---------------------------------------------------------------------

(1 row)

step s1-begin:
 BEGIN;

step s1-move-placement:
     SELECT master_move_shard_placement(get_shard_id_for_distribution_column, 'localhost', 57637, 'localhost', 57638) FROM selected_shard;
 <waiting ...>
step s2-alter-table: 
 ALTER TABLE logical_replicate_placement ADD COLUMN z INT;
 <waiting ...>
step s3-release-advisory-lock: 
    SELECT pg_advisory_unlock(44000, 55152);

pg_advisory_unlock
---------------------------------------------------------------------
t
(1 row)

step s1-move-placement: <... completed>
master_move_shard_placement
---------------------------------------------------------------------

(1 row)

step s1-end:
 COMMIT;

step s2-alter-table: <... completed>
step s1-select:
  SELECT * FROM logical_replicate_placement order by y;

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

step s1-get-shard-distribution:
    select nodeport from pg_dist_placement inner join pg_dist_node on(pg_dist_placement.groupid = pg_dist_node.groupid) where shardstate != 4 AND shardid in (SELECT * FROM selected_shard) order by nodeport;

nodeport
---------------------------------------------------------------------
   57638
(1 row)


starting permutation: s1-begin s2-begin s2-insert s1-move-placement s2-end s1-end s1-select s1-get-shard-distribution
step s1-begin:
 BEGIN;

step s2-begin:
 BEGIN;

step s2-insert:
    INSERT INTO logical_replicate_placement VALUES (15, 15), (172, 172);

step s1-move-placement:
     SELECT master_move_shard_placement(get_shard_id_for_distribution_column, 'localhost', 57637, 'localhost', 57638) FROM selected_shard;
 <waiting ...>
step s2-end: 
 COMMIT;

step s1-move-placement: <... completed>
master_move_shard_placement
---------------------------------------------------------------------

(1 row)

step s1-end:
 COMMIT;

step s1-select:
  SELECT * FROM logical_replicate_placement order by y;

  x|  y
---------------------------------------------------------------------
 15| 15
172|172
(2 rows)

step s1-get-shard-distribution:
    select nodeport from pg_dist_placement inner join pg_dist_node on(pg_dist_placement.groupid = pg_dist_node.groupid) where shardstate != 4 AND shardid in (SELECT * FROM selected_shard) order by nodeport;

nodeport
---------------------------------------------------------------------
   57638
(1 row)


starting permutation: s1-begin s2-begin s2-upsert s1-move-placement s2-end s1-end s1-select s1-get-shard-distribution
step s1-begin:
 BEGIN;

step s2-begin:
 BEGIN;

step s2-upsert:
    INSERT INTO logical_replicate_placement VALUES (15, 15), (172, 172);
    INSERT INTO logical_replicate_placement VALUES (15, 15), (172, 172) ON CONFLICT (x) DO UPDATE SET y = logical_replicate_placement.y + 1;

step s1-move-placement:
     SELECT master_move_shard_placement(get_shard_id_for_distribution_column, 'localhost', 57637, 'localhost', 57638) FROM selected_shard;
 <waiting ...>
step s2-end: 
 COMMIT;

step s1-move-placement: <... completed>
master_move_shard_placement
---------------------------------------------------------------------

(1 row)

step s1-end:
 COMMIT;

step s1-select:
  SELECT * FROM logical_replicate_placement order by y;

  x|  y
---------------------------------------------------------------------
 15| 16
172|173
(2 rows)

step s1-get-shard-distribution:
    select nodeport from pg_dist_placement inner join pg_dist_node on(pg_dist_placement.groupid = pg_dist_node.groupid) where shardstate != 4 AND shardid in (SELECT * FROM selected_shard) order by nodeport;

nodeport
---------------------------------------------------------------------
   57638
(1 row)


starting permutation: s1-insert s1-begin s2-begin s2-update s1-move-placement s2-end s1-end s1-select s1-get-shard-distribution
step s1-insert:
    INSERT INTO logical_replicate_placement VALUES (15, 15), (172, 172);

step s1-begin:
 BEGIN;

step s2-begin:
 BEGIN;

step s2-update:
    UPDATE logical_replicate_placement SET y = y + 1;

step s1-move-placement:
     SELECT master_move_shard_placement(get_shard_id_for_distribution_column, 'localhost', 57637, 'localhost', 57638) FROM selected_shard;
 <waiting ...>
step s2-end: 
 COMMIT;

step s1-move-placement: <... completed>
master_move_shard_placement
---------------------------------------------------------------------

(1 row)

step s1-end:
 COMMIT;

step s1-select:
  SELECT * FROM logical_replicate_placement order by y;

  x|  y
---------------------------------------------------------------------
 15| 16
172|173
(2 rows)

step s1-get-shard-distribution:
    select nodeport from pg_dist_placement inner join pg_dist_node on(pg_dist_placement.groupid = pg_dist_node.groupid) where shardstate != 4 AND shardid in (SELECT * FROM selected_shard) order by nodeport;

nodeport
---------------------------------------------------------------------
   57638
(1 row)


starting permutation: s1-insert s1-begin s2-begin s2-delete s1-move-placement s2-end s1-end s1-select s1-get-shard-distribution
step s1-insert:
    INSERT INTO logical_replicate_placement VALUES (15, 15), (172, 172);

step s1-begin:
 BEGIN;

step s2-begin:
 BEGIN;

step s2-delete:
    DELETE FROM logical_replicate_placement;

step s1-move-placement:
     SELECT master_move_shard_placement(get_shard_id_for_distribution_column, 'localhost', 57637, 'localhost', 57638) FROM selected_shard;
 <waiting ...>
step s2-end: 
 COMMIT;

step s1-move-placement: <... completed>
master_move_shard_placement
---------------------------------------------------------------------

(1 row)

step s1-end:
 COMMIT;

step s1-select:
  SELECT * FROM logical_replicate_placement order by y;

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

step s1-get-shard-distribution:
    select nodeport from pg_dist_placement inner join pg_dist_node on(pg_dist_placement.groupid = pg_dist_node.groupid) where shardstate != 4 AND shardid in (SELECT * FROM selected_shard) order by nodeport;

nodeport
---------------------------------------------------------------------
   57638
(1 row)


starting permutation: s1-insert s1-begin s2-begin s2-select s1-move-placement s2-end s1-end s1-get-shard-distribution
step s1-insert:
    INSERT INTO logical_replicate_placement VALUES (15, 15), (172, 172);

step s1-begin:
 BEGIN;

step s2-begin:
 BEGIN;

step s2-select:
    SELECT * FROM logical_replicate_placement ORDER BY y;

  x|  y
---------------------------------------------------------------------
 15| 15
172|172
(2 rows)

step s1-move-placement:
     SELECT master_move_shard_placement(get_shard_id_for_distribution_column, 'localhost', 57637, 'localhost', 57638) FROM selected_shard;

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

(1 row)

step s2-end:
 COMMIT;

step s1-end:
 COMMIT;

step s1-get-shard-distribution:
    select nodeport from pg_dist_placement inner join pg_dist_node on(pg_dist_placement.groupid = pg_dist_node.groupid) where shardstate != 4 AND shardid in (SELECT * FROM selected_shard) order by nodeport;

nodeport
---------------------------------------------------------------------
   57638
(1 row)


starting permutation: s1-begin s2-begin s2-copy s1-move-placement s2-end s1-end s1-select s1-get-shard-distribution
step s1-begin:
 BEGIN;

step s2-begin:
 BEGIN;

step s2-copy:
 COPY logical_replicate_placement FROM PROGRAM 'echo "1,1\n2,2\n3,3\n4,4\n5,5\n15,30"' WITH CSV;

step s1-move-placement:
     SELECT master_move_shard_placement(get_shard_id_for_distribution_column, 'localhost', 57637, 'localhost', 57638) FROM selected_shard;
 <waiting ...>
step s2-end: 
 COMMIT;

step s1-move-placement: <... completed>
master_move_shard_placement
---------------------------------------------------------------------

(1 row)

step s1-end:
 COMMIT;

step s1-select:
  SELECT * FROM logical_replicate_placement order by y;

 x| y
---------------------------------------------------------------------
 1| 1
 2| 2
 3| 3
 4| 4
 5| 5
15|30
(6 rows)

step s1-get-shard-distribution:
    select nodeport from pg_dist_placement inner join pg_dist_node on(pg_dist_placement.groupid = pg_dist_node.groupid) where shardstate != 4 AND shardid in (SELECT * FROM selected_shard) order by nodeport;

nodeport
---------------------------------------------------------------------
   57638
(1 row)


starting permutation: s1-insert s1-begin s2-begin s2-truncate s1-move-placement s2-end s1-end s1-select s1-get-shard-distribution
step s1-insert:
    INSERT INTO logical_replicate_placement VALUES (15, 15), (172, 172);

step s1-begin:
 BEGIN;

step s2-begin:
 BEGIN;

step s2-truncate:
 TRUNCATE logical_replicate_placement;

step s1-move-placement:
     SELECT master_move_shard_placement(get_shard_id_for_distribution_column, 'localhost', 57637, 'localhost', 57638) FROM selected_shard;
 <waiting ...>
step s2-end: 
 COMMIT;

step s1-move-placement: <... completed>
master_move_shard_placement
---------------------------------------------------------------------

(1 row)

step s1-end:
 COMMIT;

step s1-select:
  SELECT * FROM logical_replicate_placement order by y;

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

step s1-get-shard-distribution:
    select nodeport from pg_dist_placement inner join pg_dist_node on(pg_dist_placement.groupid = pg_dist_node.groupid) where shardstate != 4 AND shardid in (SELECT * FROM selected_shard) order by nodeport;

nodeport
---------------------------------------------------------------------
   57638
(1 row)


starting permutation: s1-begin s2-begin s2-alter-table s1-move-placement s2-end s1-end s1-select s1-get-shard-distribution
step s1-begin:
 BEGIN;

step s2-begin:
 BEGIN;

step s2-alter-table:
 ALTER TABLE logical_replicate_placement ADD COLUMN z INT;

step s1-move-placement:
     SELECT master_move_shard_placement(get_shard_id_for_distribution_column, 'localhost', 57637, 'localhost', 57638) FROM selected_shard;
 <waiting ...>
step s2-end: 
 COMMIT;

step s1-move-placement: <... completed>
master_move_shard_placement
---------------------------------------------------------------------

(1 row)

step s1-end:
 COMMIT;

step s1-select:
  SELECT * FROM logical_replicate_placement order by y;

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

step s1-get-shard-distribution:
    select nodeport from pg_dist_placement inner join pg_dist_node on(pg_dist_placement.groupid = pg_dist_node.groupid) where shardstate != 4 AND shardid in (SELECT * FROM selected_shard) order by nodeport;

nodeport
---------------------------------------------------------------------
   57638
(1 row)

