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((SELECT * FROM selected_shard), 'localhost', 57637, 'localhost', 57638);
 <waiting ...>
step s2-insert: 
    INSERT INTO logical_replicate_placement VALUES (15, 15);

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
(1 row)

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((SELECT * FROM selected_shard), 'localhost', 57637, 'localhost', 57638);
 <waiting ...>
step s2-upsert: 
    INSERT INTO logical_replicate_placement VALUES (15, 15);
    INSERT INTO logical_replicate_placement VALUES (15, 15) 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
(1 row)

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

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((SELECT * FROM selected_shard), 'localhost', 57637, 'localhost', 57638);
 <waiting ...>
step s2-update: 
    UPDATE logical_replicate_placement SET y = y + 1 WHERE x = 15;

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
(1 row)

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

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((SELECT * FROM selected_shard), 'localhost', 57637, 'localhost', 57638);
 <waiting ...>
step s2-delete: 
    DELETE FROM logical_replicate_placement WHERE x = 15;

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

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((SELECT * FROM selected_shard), 'localhost', 57637, 'localhost', 57638);
 <waiting ...>
step s2-select: 
    SELECT * FROM logical_replicate_placement ORDER BY y;

 x| y
---------------------------------------------------------------------
15|15
(1 row)

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: s1-insert s3-acquire-advisory-lock s1-begin s1-move-placement s2-select-for-update s3-release-advisory-lock s1-end s1-get-shard-distribution
step s1-insert:
    INSERT INTO logical_replicate_placement VALUES (15, 15);

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((SELECT * FROM selected_shard), 'localhost', 57637, 'localhost', 57638);
 <waiting ...>
step s2-select-for-update: 
    SELECT * FROM logical_replicate_placement WHERE x=15 FOR UPDATE;

 x| y
---------------------------------------------------------------------
15|15
(1 row)

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

step s1-move-placement:
     SELECT master_move_shard_placement((SELECT * FROM selected_shard), 'localhost', 57637, 'localhost', 57638);
 <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
(1 row)

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);
    INSERT INTO logical_replicate_placement VALUES (15, 15) ON CONFLICT (x) DO UPDATE SET y = logical_replicate_placement.y + 1;

step s1-move-placement:
     SELECT master_move_shard_placement((SELECT * FROM selected_shard), 'localhost', 57637, 'localhost', 57638);
 <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
(1 row)

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

step s1-begin:
 BEGIN;

step s2-begin:
    BEGIN;

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

step s1-move-placement:
     SELECT master_move_shard_placement((SELECT * FROM selected_shard), 'localhost', 57637, 'localhost', 57638);
 <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
(1 row)

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

step s1-begin:
 BEGIN;

step s2-begin:
    BEGIN;

step s2-delete:
    DELETE FROM logical_replicate_placement WHERE x = 15;

step s1-move-placement:
     SELECT master_move_shard_placement((SELECT * FROM selected_shard), 'localhost', 57637, 'localhost', 57638);
 <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);

step s1-begin:
 BEGIN;

step s2-begin:
    BEGIN;

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

 x| y
---------------------------------------------------------------------
15|15
(1 row)

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

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-insert s1-begin s2-begin s2-select-for-update s1-move-placement s2-end s1-end s1-get-shard-distribution
step s1-insert:
    INSERT INTO logical_replicate_placement VALUES (15, 15);

step s1-begin:
 BEGIN;

step s2-begin:
    BEGIN;

step s2-select-for-update:
    SELECT * FROM logical_replicate_placement WHERE x=15 FOR UPDATE;

 x| y
---------------------------------------------------------------------
15|15
(1 row)

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

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: s1-begin s2-begin s1-move-placement s2-move-placement s1-end s2-end
step s1-begin:
 BEGIN;

step s2-begin:
    BEGIN;

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

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

(1 row)

step s2-move-placement:
 SELECT master_move_shard_placement(
  get_shard_id_for_distribution_column('logical_replicate_placement', 4),
  'localhost', 57637, 'localhost', 57638);

ERROR:  could not acquire the lock required to move public.logical_replicate_placement
step s1-end:
 COMMIT;

step s2-end:
   COMMIT;

