Parsed test spec with 3 sessions

starting permutation: s3-acquire-advisory-lock s1-begin s1-move-placement s2-start-session-level-connection s2-begin-on-worker s2-insert s2-commit-worker s3-release-advisory-lock s1-commit s1-select s1-get-shard-distribution s2-stop-connection
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-start-session-level-connection: 
  SELECT start_session_level_connection_to_node('localhost', 57638);

start_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)

step s2-begin-on-worker:
  SELECT run_commands_on_session_level_connection_to_node('BEGIN');

run_commands_on_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)

step s2-insert:
  SELECT run_commands_on_session_level_connection_to_node('INSERT INTO logical_replicate_placement VALUES (15, 15)');

run_commands_on_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)

step s2-commit-worker:
  SELECT run_commands_on_session_level_connection_to_node('COMMIT');

run_commands_on_session_level_connection_to_node
---------------------------------------------------------------------

(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-commit:
 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)

step s2-stop-connection:
  SELECT stop_session_level_connection_to_node();

stop_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)


starting permutation: s1-insert s3-acquire-advisory-lock s1-begin s1-move-placement s2-start-session-level-connection s2-begin-on-worker s2-update s2-commit-worker s3-release-advisory-lock s1-commit s1-select s1-get-shard-distribution s2-stop-connection
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-start-session-level-connection: 
  SELECT start_session_level_connection_to_node('localhost', 57638);

start_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)

step s2-begin-on-worker:
  SELECT run_commands_on_session_level_connection_to_node('BEGIN');

run_commands_on_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)

step s2-update:
  SELECT run_commands_on_session_level_connection_to_node('UPDATE logical_replicate_placement SET y = y + 1 WHERE x = 15');

run_commands_on_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)

step s2-commit-worker:
  SELECT run_commands_on_session_level_connection_to_node('COMMIT');

run_commands_on_session_level_connection_to_node
---------------------------------------------------------------------

(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-commit:
 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)

step s2-stop-connection:
  SELECT stop_session_level_connection_to_node();

stop_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)


starting permutation: s1-insert s3-acquire-advisory-lock s1-begin s1-move-placement s2-start-session-level-connection s2-begin-on-worker s2-delete s2-commit-worker s3-release-advisory-lock s1-commit s1-select s1-get-shard-distribution s2-stop-connection
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-start-session-level-connection: 
  SELECT start_session_level_connection_to_node('localhost', 57638);

start_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)

step s2-begin-on-worker:
  SELECT run_commands_on_session_level_connection_to_node('BEGIN');

run_commands_on_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)

step s2-delete:
  SELECT run_commands_on_session_level_connection_to_node('DELETE FROM logical_replicate_placement WHERE x = 15');

run_commands_on_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)

step s2-commit-worker:
  SELECT run_commands_on_session_level_connection_to_node('COMMIT');

run_commands_on_session_level_connection_to_node
---------------------------------------------------------------------

(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-commit:
 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)

step s2-stop-connection:
  SELECT stop_session_level_connection_to_node();

stop_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)


starting permutation: s1-insert s3-acquire-advisory-lock s1-begin s1-move-placement s2-start-session-level-connection s2-begin-on-worker s2-select s2-commit-worker s3-release-advisory-lock s1-commit s1-get-shard-distribution s2-stop-connection
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-start-session-level-connection: 
  SELECT start_session_level_connection_to_node('localhost', 57638);

start_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)

step s2-begin-on-worker:
  SELECT run_commands_on_session_level_connection_to_node('BEGIN');

run_commands_on_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)

step s2-select:
  SELECT run_commands_on_session_level_connection_to_node('SELECT * FROM logical_replicate_placement ORDER BY y');

run_commands_on_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)

step s2-commit-worker:
  SELECT run_commands_on_session_level_connection_to_node('COMMIT');

run_commands_on_session_level_connection_to_node
---------------------------------------------------------------------

(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-commit:
 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)

step s2-stop-connection:
  SELECT stop_session_level_connection_to_node();

stop_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)


starting permutation: s1-insert s3-acquire-advisory-lock s1-begin s1-move-placement s2-start-session-level-connection s2-begin-on-worker s2-select-for-update s2-commit-worker s3-release-advisory-lock s1-commit s1-get-shard-distribution s2-stop-connection
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-start-session-level-connection: 
  SELECT start_session_level_connection_to_node('localhost', 57638);

start_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)

step s2-begin-on-worker:
  SELECT run_commands_on_session_level_connection_to_node('BEGIN');

run_commands_on_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)

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

run_commands_on_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)

step s2-commit-worker:
  SELECT run_commands_on_session_level_connection_to_node('COMMIT');

run_commands_on_session_level_connection_to_node
---------------------------------------------------------------------

(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-commit:
 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)

step s2-stop-connection:
  SELECT stop_session_level_connection_to_node();

stop_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)


starting permutation: s1-begin s2-start-session-level-connection s2-begin-on-worker s2-insert s1-move-placement s2-commit-worker s1-commit s1-select s1-get-shard-distribution s2-stop-connection
step s1-begin:
  BEGIN;

step s2-start-session-level-connection:
  SELECT start_session_level_connection_to_node('localhost', 57638);

start_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)

step s2-begin-on-worker:
  SELECT run_commands_on_session_level_connection_to_node('BEGIN');

run_commands_on_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)

step s2-insert:
  SELECT run_commands_on_session_level_connection_to_node('INSERT INTO logical_replicate_placement VALUES (15, 15)');

run_commands_on_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)

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

run_commands_on_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)

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

(1 row)

step s1-commit:
 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)

step s2-stop-connection:
  SELECT stop_session_level_connection_to_node();

stop_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)


starting permutation: s1-insert s1-begin s2-start-session-level-connection s2-begin-on-worker s2-update s1-move-placement s2-commit-worker s1-commit s1-select s1-get-shard-distribution s2-stop-connection
step s1-insert:
  INSERT INTO logical_replicate_placement VALUES (15, 15);

step s1-begin:
  BEGIN;

step s2-start-session-level-connection:
  SELECT start_session_level_connection_to_node('localhost', 57638);

start_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)

step s2-begin-on-worker:
  SELECT run_commands_on_session_level_connection_to_node('BEGIN');

run_commands_on_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)

step s2-update:
  SELECT run_commands_on_session_level_connection_to_node('UPDATE logical_replicate_placement SET y = y + 1 WHERE x = 15');

run_commands_on_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)

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

run_commands_on_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)

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

(1 row)

step s1-commit:
 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)

step s2-stop-connection:
  SELECT stop_session_level_connection_to_node();

stop_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)


starting permutation: s1-insert s1-begin s2-start-session-level-connection s2-begin-on-worker s2-delete s1-move-placement s2-commit-worker s1-commit s1-select s1-get-shard-distribution s2-stop-connection
step s1-insert:
  INSERT INTO logical_replicate_placement VALUES (15, 15);

step s1-begin:
  BEGIN;

step s2-start-session-level-connection:
  SELECT start_session_level_connection_to_node('localhost', 57638);

start_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)

step s2-begin-on-worker:
  SELECT run_commands_on_session_level_connection_to_node('BEGIN');

run_commands_on_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)

step s2-delete:
  SELECT run_commands_on_session_level_connection_to_node('DELETE FROM logical_replicate_placement WHERE x = 15');

run_commands_on_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)

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

run_commands_on_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)

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

(1 row)

step s1-commit:
 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)

step s2-stop-connection:
  SELECT stop_session_level_connection_to_node();

stop_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)


starting permutation: s1-insert s1-begin s2-start-session-level-connection s2-begin-on-worker s2-select s1-move-placement s2-commit-worker s1-commit s1-get-shard-distribution s2-stop-connection
step s1-insert:
  INSERT INTO logical_replicate_placement VALUES (15, 15);

step s1-begin:
  BEGIN;

step s2-start-session-level-connection:
  SELECT start_session_level_connection_to_node('localhost', 57638);

start_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)

step s2-begin-on-worker:
  SELECT run_commands_on_session_level_connection_to_node('BEGIN');

run_commands_on_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)

step s2-select:
  SELECT run_commands_on_session_level_connection_to_node('SELECT * FROM logical_replicate_placement ORDER BY y');

run_commands_on_session_level_connection_to_node
---------------------------------------------------------------------

(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-commit-worker:
  SELECT run_commands_on_session_level_connection_to_node('COMMIT');

run_commands_on_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)

step s1-commit:
 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)

step s2-stop-connection:
  SELECT stop_session_level_connection_to_node();

stop_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)


starting permutation: s1-insert s1-begin s2-start-session-level-connection s2-begin-on-worker s2-select-for-update s1-move-placement s2-commit-worker s1-commit s1-get-shard-distribution s2-stop-connection
step s1-insert:
  INSERT INTO logical_replicate_placement VALUES (15, 15);

step s1-begin:
  BEGIN;

step s2-start-session-level-connection:
  SELECT start_session_level_connection_to_node('localhost', 57638);

start_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)

step s2-begin-on-worker:
  SELECT run_commands_on_session_level_connection_to_node('BEGIN');

run_commands_on_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)

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

run_commands_on_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)

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

run_commands_on_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)

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

(1 row)

step s1-commit:
 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)

step s2-stop-connection:
  SELECT stop_session_level_connection_to_node();

stop_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)

