Parsed test spec with 8 sessions

starting permutation: s1-begin s1-update-ref-table-from-coordinator s2-start-session-level-connection s2-begin-on-worker s2-update-ref-table s3-select-distributed-waiting-queries s1-commit s2-commit-worker s2-stop-connection
step s1-begin:
	BEGIN;

step s1-update-ref-table-from-coordinator:
	UPDATE ref_table SET value_1 = 15;

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-ref-table:
	SELECT run_commands_on_session_level_connection_to_node('UPDATE ref_table SET value_1 = 12 WHERE user_id = 1');
 <waiting ...>
step s3-select-distributed-waiting-queries: 
	SELECT blocked_statement, current_statement_in_blocking_process FROM citus_lock_waits WHERE blocked_statement NOT ILIKE '%run_commands_on_session_level_connection_to_node%' AND current_statement_in_blocking_process NOT ILIKE '%run_commands_on_session_level_connection_to_node%';

blocked_statement                                  |current_statement_in_blocking_process
---------------------------------------------------------------------
UPDATE ref_table SET value_1 = 12 WHERE user_id = 1|
	UPDATE ref_table SET value_1 = 15;

(1 row)

step s1-commit:
	COMMIT;

step s2-update-ref-table: <... completed>
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 s2-stop-connection:
	SELECT stop_session_level_connection_to_node();

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

(1 row)

citus_remove_node
---------------------------------------------------------------------

(1 row)


starting permutation: s1-start-session-level-connection s1-begin-on-worker s1-update-ref-table s2-start-session-level-connection s2-begin-on-worker s2-update-ref-table s3-select-distributed-waiting-queries s1-commit-worker s2-commit-worker s1-stop-connection s2-stop-connection
step s1-start-session-level-connection:
	SELECT start_session_level_connection_to_node('localhost', 57637);

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

(1 row)

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

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

(1 row)

step s1-update-ref-table:
	SELECT run_commands_on_session_level_connection_to_node('UPDATE ref_table SET value_1 = 12 WHERE user_id = 1');

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

(1 row)

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-ref-table:
	SELECT run_commands_on_session_level_connection_to_node('UPDATE ref_table SET value_1 = 12 WHERE user_id = 1');
 <waiting ...>
step s3-select-distributed-waiting-queries: 
	SELECT blocked_statement, current_statement_in_blocking_process FROM citus_lock_waits WHERE blocked_statement NOT ILIKE '%run_commands_on_session_level_connection_to_node%' AND current_statement_in_blocking_process NOT ILIKE '%run_commands_on_session_level_connection_to_node%';

blocked_statement                                  |current_statement_in_blocking_process
---------------------------------------------------------------------
UPDATE ref_table SET value_1 = 12 WHERE user_id = 1|UPDATE ref_table SET value_1 = 12 WHERE user_id = 1
(1 row)

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

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

(1 row)

step s2-update-ref-table: <... completed>
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 s1-stop-connection:
	SELECT stop_session_level_connection_to_node();

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

(1 row)

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

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

(1 row)

citus_remove_node
---------------------------------------------------------------------

(1 row)


starting permutation: s1-start-session-level-connection s1-begin-on-worker s1-update-dist-table s2-start-session-level-connection s2-begin-on-worker s2-update-dist-table s3-select-distributed-waiting-queries s1-commit-worker s2-commit-worker s1-stop-connection s2-stop-connection
step s1-start-session-level-connection:
	SELECT start_session_level_connection_to_node('localhost', 57637);

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

(1 row)

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

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

(1 row)

step s1-update-dist-table:
	SELECT run_commands_on_session_level_connection_to_node('UPDATE tt1 SET value_1 = 4');

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

(1 row)

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-dist-table:
	SELECT run_commands_on_session_level_connection_to_node('UPDATE tt1 SET value_1 = 5');
 <waiting ...>
step s3-select-distributed-waiting-queries: 
	SELECT blocked_statement, current_statement_in_blocking_process FROM citus_lock_waits WHERE blocked_statement NOT ILIKE '%run_commands_on_session_level_connection_to_node%' AND current_statement_in_blocking_process NOT ILIKE '%run_commands_on_session_level_connection_to_node%';

blocked_statement         |current_statement_in_blocking_process
---------------------------------------------------------------------
UPDATE tt1 SET value_1 = 5|UPDATE tt1 SET value_1 = 4
(1 row)

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

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

(1 row)

step s2-update-dist-table: <... completed>
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 s1-stop-connection:
	SELECT stop_session_level_connection_to_node();

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

(1 row)

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

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

(1 row)

citus_remove_node
---------------------------------------------------------------------

(1 row)


starting permutation: s1-start-session-level-connection s1-begin-on-worker s1-delete-from-ref-table s2-start-session-level-connection s2-begin-on-worker s2-update-ref-table s3-select-distributed-waiting-queries s1-commit-worker s2-commit-worker s1-stop-connection s2-stop-connection
step s1-start-session-level-connection:
	SELECT start_session_level_connection_to_node('localhost', 57637);

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

(1 row)

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

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

(1 row)

step s1-delete-from-ref-table:
	SELECT run_commands_on_session_level_connection_to_node('DELETE FROM ref_table WHERE user_id = 1');

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

(1 row)

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-ref-table:
	SELECT run_commands_on_session_level_connection_to_node('UPDATE ref_table SET value_1 = 12 WHERE user_id = 1');
 <waiting ...>
step s3-select-distributed-waiting-queries: 
	SELECT blocked_statement, current_statement_in_blocking_process FROM citus_lock_waits WHERE blocked_statement NOT ILIKE '%run_commands_on_session_level_connection_to_node%' AND current_statement_in_blocking_process NOT ILIKE '%run_commands_on_session_level_connection_to_node%';

blocked_statement                                  |current_statement_in_blocking_process
---------------------------------------------------------------------
UPDATE ref_table SET value_1 = 12 WHERE user_id = 1|DELETE FROM ref_table WHERE user_id = 1
(1 row)

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

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

(1 row)

step s2-update-ref-table: <... completed>
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 s1-stop-connection:
	SELECT stop_session_level_connection_to_node();

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

(1 row)

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

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

(1 row)

citus_remove_node
---------------------------------------------------------------------

(1 row)


starting permutation: s1-start-session-level-connection s1-begin-on-worker s1-insert-into-ref-table s2-start-session-level-connection s2-begin-on-worker s2-update-ref-table s3-select-distributed-waiting-queries s1-commit-worker s2-commit-worker s1-stop-connection s2-stop-connection
step s1-start-session-level-connection:
	SELECT start_session_level_connection_to_node('localhost', 57637);

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

(1 row)

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

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

(1 row)

step s1-insert-into-ref-table:
	SELECT run_commands_on_session_level_connection_to_node('INSERT INTO ref_table VALUES(8,81),(9,91)');

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

(1 row)

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-ref-table:
	SELECT run_commands_on_session_level_connection_to_node('UPDATE ref_table SET value_1 = 12 WHERE user_id = 1');
 <waiting ...>
step s3-select-distributed-waiting-queries: 
	SELECT blocked_statement, current_statement_in_blocking_process FROM citus_lock_waits WHERE blocked_statement NOT ILIKE '%run_commands_on_session_level_connection_to_node%' AND current_statement_in_blocking_process NOT ILIKE '%run_commands_on_session_level_connection_to_node%';

blocked_statement                                  |current_statement_in_blocking_process
---------------------------------------------------------------------
UPDATE ref_table SET value_1 = 12 WHERE user_id = 1|INSERT INTO ref_table VALUES(8,81),(9,91)
(1 row)

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

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

(1 row)

step s2-update-ref-table: <... completed>
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 s1-stop-connection:
	SELECT stop_session_level_connection_to_node();

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

(1 row)

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

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

(1 row)

citus_remove_node
---------------------------------------------------------------------

(1 row)


starting permutation: s1-start-session-level-connection s1-begin-on-worker s1-insert-into-ref-table s2-start-session-level-connection s2-begin-on-worker s2-insert-into-ref-table s3-select-distributed-waiting-queries s1-commit-worker s2-commit-worker s1-stop-connection s2-stop-connection
step s1-start-session-level-connection:
	SELECT start_session_level_connection_to_node('localhost', 57637);

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

(1 row)

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

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

(1 row)

step s1-insert-into-ref-table:
	SELECT run_commands_on_session_level_connection_to_node('INSERT INTO ref_table VALUES(8,81),(9,91)');

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

(1 row)

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-into-ref-table:
	SELECT run_commands_on_session_level_connection_to_node('INSERT INTO ref_table VALUES(8,81),(9,91)');

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

(1 row)

step s3-select-distributed-waiting-queries:
	SELECT blocked_statement, current_statement_in_blocking_process FROM citus_lock_waits WHERE blocked_statement NOT ILIKE '%run_commands_on_session_level_connection_to_node%' AND current_statement_in_blocking_process NOT ILIKE '%run_commands_on_session_level_connection_to_node%';

blocked_statement|current_statement_in_blocking_process
---------------------------------------------------------------------
(0 rows)

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

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 s1-stop-connection:
	SELECT stop_session_level_connection_to_node();

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

(1 row)

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

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

(1 row)

citus_remove_node
---------------------------------------------------------------------

(1 row)


starting permutation: s1-start-session-level-connection s1-begin-on-worker s1-copy-to-ref-table s2-start-session-level-connection s2-begin-on-worker s2-update-ref-table s3-select-distributed-waiting-queries s1-commit-worker s2-commit-worker s1-stop-connection s2-stop-connection
step s1-start-session-level-connection:
	SELECT start_session_level_connection_to_node('localhost', 57637);

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

(1 row)

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

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

(1 row)

step s1-copy-to-ref-table:
	SELECT run_commands_on_session_level_connection_to_node('COPY ref_table FROM PROGRAM ''echo 10, 101 && echo 11, 111'' WITH CSV');

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

(1 row)

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-ref-table:
	SELECT run_commands_on_session_level_connection_to_node('UPDATE ref_table SET value_1 = 12 WHERE user_id = 1');
 <waiting ...>
step s3-select-distributed-waiting-queries: 
	SELECT blocked_statement, current_statement_in_blocking_process FROM citus_lock_waits WHERE blocked_statement NOT ILIKE '%run_commands_on_session_level_connection_to_node%' AND current_statement_in_blocking_process NOT ILIKE '%run_commands_on_session_level_connection_to_node%';

blocked_statement                                  |current_statement_in_blocking_process
---------------------------------------------------------------------
UPDATE ref_table SET value_1 = 12 WHERE user_id = 1|COPY ref_table FROM PROGRAM 'echo 10, 101 && echo 11, 111' WITH CSV
(1 row)

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

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

(1 row)

step s2-update-ref-table: <... completed>
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 s1-stop-connection:
	SELECT stop_session_level_connection_to_node();

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

(1 row)

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

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

(1 row)

citus_remove_node
---------------------------------------------------------------------

(1 row)


starting permutation: s1-start-session-level-connection s1-begin-on-worker s1-copy-to-ref-table s2-start-session-level-connection s2-begin-on-worker s2-insert-into-ref-table s3-select-distributed-waiting-queries s1-commit-worker s2-commit-worker s1-stop-connection s2-stop-connection
step s1-start-session-level-connection:
	SELECT start_session_level_connection_to_node('localhost', 57637);

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

(1 row)

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

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

(1 row)

step s1-copy-to-ref-table:
	SELECT run_commands_on_session_level_connection_to_node('COPY ref_table FROM PROGRAM ''echo 10, 101 && echo 11, 111'' WITH CSV');

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

(1 row)

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-into-ref-table:
	SELECT run_commands_on_session_level_connection_to_node('INSERT INTO ref_table VALUES(8,81),(9,91)');

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

(1 row)

step s3-select-distributed-waiting-queries:
	SELECT blocked_statement, current_statement_in_blocking_process FROM citus_lock_waits WHERE blocked_statement NOT ILIKE '%run_commands_on_session_level_connection_to_node%' AND current_statement_in_blocking_process NOT ILIKE '%run_commands_on_session_level_connection_to_node%';

blocked_statement|current_statement_in_blocking_process
---------------------------------------------------------------------
(0 rows)

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

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 s1-stop-connection:
	SELECT stop_session_level_connection_to_node();

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

(1 row)

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

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

(1 row)

citus_remove_node
---------------------------------------------------------------------

(1 row)


starting permutation: s1-start-session-level-connection s1-begin-on-worker s1-copy-to-ref-table s2-start-session-level-connection s2-begin-on-worker s2-copy-to-ref-table s3-select-distributed-waiting-queries s1-commit-worker s2-commit-worker s1-stop-connection s2-stop-connection
step s1-start-session-level-connection:
	SELECT start_session_level_connection_to_node('localhost', 57637);

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

(1 row)

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

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

(1 row)

step s1-copy-to-ref-table:
	SELECT run_commands_on_session_level_connection_to_node('COPY ref_table FROM PROGRAM ''echo 10, 101 && echo 11, 111'' WITH CSV');

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

(1 row)

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-copy-to-ref-table:
	SELECT run_commands_on_session_level_connection_to_node('COPY ref_table FROM PROGRAM ''echo 10, 101 && echo 11, 111'' WITH CSV');

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

(1 row)

step s3-select-distributed-waiting-queries:
	SELECT blocked_statement, current_statement_in_blocking_process FROM citus_lock_waits WHERE blocked_statement NOT ILIKE '%run_commands_on_session_level_connection_to_node%' AND current_statement_in_blocking_process NOT ILIKE '%run_commands_on_session_level_connection_to_node%';

blocked_statement|current_statement_in_blocking_process
---------------------------------------------------------------------
(0 rows)

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

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 s1-stop-connection:
	SELECT stop_session_level_connection_to_node();

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

(1 row)

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

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

(1 row)

citus_remove_node
---------------------------------------------------------------------

(1 row)


starting permutation: s1-start-session-level-connection s1-begin-on-worker s1-select-for-update s2-start-session-level-connection s2-begin-on-worker s2-update-ref-table s3-select-distributed-waiting-queries s1-commit-worker s2-commit-worker s1-stop-connection s2-stop-connection
step s1-start-session-level-connection:
	SELECT start_session_level_connection_to_node('localhost', 57637);

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

(1 row)

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

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

(1 row)

step s1-select-for-update:
	SELECT run_commands_on_session_level_connection_to_node('SELECT * FROM ref_table FOR UPDATE');

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

(1 row)

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-ref-table:
	SELECT run_commands_on_session_level_connection_to_node('UPDATE ref_table SET value_1 = 12 WHERE user_id = 1');
 <waiting ...>
step s3-select-distributed-waiting-queries: 
	SELECT blocked_statement, current_statement_in_blocking_process FROM citus_lock_waits WHERE blocked_statement NOT ILIKE '%run_commands_on_session_level_connection_to_node%' AND current_statement_in_blocking_process NOT ILIKE '%run_commands_on_session_level_connection_to_node%';

blocked_statement                                  |current_statement_in_blocking_process
---------------------------------------------------------------------
UPDATE ref_table SET value_1 = 12 WHERE user_id = 1|SELECT * FROM ref_table FOR UPDATE
(1 row)

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

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

(1 row)

step s2-update-ref-table: <... completed>
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 s1-stop-connection:
	SELECT stop_session_level_connection_to_node();

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

(1 row)

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

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

(1 row)

citus_remove_node
---------------------------------------------------------------------

(1 row)


starting permutation: s2-start-session-level-connection s2-begin-on-worker s2-insert-into-ref-table s1-begin s1-alter-table s3-select-distributed-waiting-queries s2-commit-worker s1-commit s2-stop-connection
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-into-ref-table:
	SELECT run_commands_on_session_level_connection_to_node('INSERT INTO ref_table VALUES(8,81),(9,91)');

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

(1 row)

step s1-begin:
	BEGIN;

step s1-alter-table:
	ALTER TABLE ref_table ADD CONSTRAINT rf_p_key PRIMARY KEY(user_id);
 <waiting ...>
step s3-select-distributed-waiting-queries: 
	SELECT blocked_statement, current_statement_in_blocking_process FROM citus_lock_waits WHERE blocked_statement NOT ILIKE '%run_commands_on_session_level_connection_to_node%' AND current_statement_in_blocking_process NOT ILIKE '%run_commands_on_session_level_connection_to_node%';

blocked_statement                                                     |current_statement_in_blocking_process
---------------------------------------------------------------------

	ALTER TABLE ref_table ADD CONSTRAINT rf_p_key PRIMARY KEY(user_id);
|INSERT INTO ref_table VALUES(8,81),(9,91)
(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-alter-table: <... completed>
step s1-commit:
	COMMIT;

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

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

(1 row)

citus_remove_node
---------------------------------------------------------------------

(1 row)


starting permutation: s1-begin s1-update-on-the-coordinator s2-update-on-the-coordinator s3-select-distributed-waiting-queries s1-commit
step s1-begin:
	BEGIN;

step s1-update-on-the-coordinator:
	UPDATE tt1 SET value_1 = 4;

step s2-update-on-the-coordinator:
	UPDATE tt1 SET value_1 = 4;
 <waiting ...>
step s3-select-distributed-waiting-queries: 
	SELECT blocked_statement, current_statement_in_blocking_process FROM citus_lock_waits WHERE blocked_statement NOT ILIKE '%run_commands_on_session_level_connection_to_node%' AND current_statement_in_blocking_process NOT ILIKE '%run_commands_on_session_level_connection_to_node%';

blocked_statement             |current_statement_in_blocking_process
---------------------------------------------------------------------

	UPDATE tt1 SET value_1 = 4;
|
	UPDATE tt1 SET value_1 = 4;

(1 row)

step s1-commit:
	COMMIT;

step s2-update-on-the-coordinator: <... completed>
citus_remove_node
---------------------------------------------------------------------

(1 row)


starting permutation: s1-start-session-level-connection s1-begin-on-worker s1-update-dist-table s4-start-session-level-connection s4-begin-on-worker s4-update-dist-table s3-select-distributed-waiting-queries s1-commit-worker s4-commit-worker s1-stop-connection s4-stop-connection
step s1-start-session-level-connection:
	SELECT start_session_level_connection_to_node('localhost', 57637);

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

(1 row)

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

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

(1 row)

step s1-update-dist-table:
	SELECT run_commands_on_session_level_connection_to_node('UPDATE tt1 SET value_1 = 4');

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

(1 row)

step s4-start-session-level-connection:
	SELECT start_session_level_connection_to_node('localhost', 57637);

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

(1 row)

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

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

(1 row)

step s4-update-dist-table:
	SELECT run_commands_on_session_level_connection_to_node('UPDATE tt1 SET value_1 = 5');
 <waiting ...>
step s3-select-distributed-waiting-queries: 
	SELECT blocked_statement, current_statement_in_blocking_process FROM citus_lock_waits WHERE blocked_statement NOT ILIKE '%run_commands_on_session_level_connection_to_node%' AND current_statement_in_blocking_process NOT ILIKE '%run_commands_on_session_level_connection_to_node%';

blocked_statement         |current_statement_in_blocking_process
---------------------------------------------------------------------
UPDATE tt1 SET value_1 = 5|UPDATE tt1 SET value_1 = 4
(1 row)

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

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

(1 row)

step s4-update-dist-table: <... completed>
run_commands_on_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)

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

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

(1 row)

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

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

(1 row)

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

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

(1 row)

citus_remove_node
---------------------------------------------------------------------

(1 row)


starting permutation: s1-start-session-level-connection s1-begin-on-worker s1-update-dist-table-id-1 s2-start-session-level-connection s2-update-dist-table-id-1 s3-select-distributed-waiting-queries s1-commit-worker s1-stop-connection s2-stop-connection
step s1-start-session-level-connection:
	SELECT start_session_level_connection_to_node('localhost', 57637);

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

(1 row)

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

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

(1 row)

step s1-update-dist-table-id-1:
	SELECT run_commands_on_session_level_connection_to_node('UPDATE tt1 SET value_1 = 4 WHERE user_id = 1');

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

(1 row)

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-update-dist-table-id-1:
	SELECT run_commands_on_session_level_connection_to_node('UPDATE tt1 SET value_1 = 4 WHERE user_id = 1');
 <waiting ...>
step s3-select-distributed-waiting-queries: 
	SELECT blocked_statement, current_statement_in_blocking_process FROM citus_lock_waits WHERE blocked_statement NOT ILIKE '%run_commands_on_session_level_connection_to_node%' AND current_statement_in_blocking_process NOT ILIKE '%run_commands_on_session_level_connection_to_node%';

blocked_statement                           |current_statement_in_blocking_process
---------------------------------------------------------------------
UPDATE tt1 SET value_1 = 4 WHERE user_id = 1|UPDATE tt1 SET value_1 = 4 WHERE user_id = 1
(1 row)

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

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

(1 row)

step s2-update-dist-table-id-1: <... completed>
run_commands_on_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)

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

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

(1 row)

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

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

(1 row)

citus_remove_node
---------------------------------------------------------------------

(1 row)


starting permutation: s1-begin s1-update-ref-table-from-coordinator s2-start-session-level-connection s2-update-ref-table s3-select-distributed-waiting-queries s1-commit s2-stop-connection
step s1-begin:
	BEGIN;

step s1-update-ref-table-from-coordinator:
	UPDATE ref_table SET value_1 = 15;

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-update-ref-table:
	SELECT run_commands_on_session_level_connection_to_node('UPDATE ref_table SET value_1 = 12 WHERE user_id = 1');
 <waiting ...>
step s3-select-distributed-waiting-queries: 
	SELECT blocked_statement, current_statement_in_blocking_process FROM citus_lock_waits WHERE blocked_statement NOT ILIKE '%run_commands_on_session_level_connection_to_node%' AND current_statement_in_blocking_process NOT ILIKE '%run_commands_on_session_level_connection_to_node%';

blocked_statement                                  |current_statement_in_blocking_process
---------------------------------------------------------------------
UPDATE ref_table SET value_1 = 12 WHERE user_id = 1|
	UPDATE ref_table SET value_1 = 15;

(1 row)

step s1-commit:
	COMMIT;

step s2-update-ref-table: <... completed>
run_commands_on_session_level_connection_to_node
---------------------------------------------------------------------

(1 row)

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

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

(1 row)

citus_remove_node
---------------------------------------------------------------------

(1 row)


starting permutation: s5-begin s5-alter s6-select s3-select-distributed-waiting-queries s5-rollback
step s5-begin:
	BEGIN;

step s5-alter:
	ALTER TABLE tt1 ADD COLUMN new_column INT;

step s6-select:
	SELECT user_id FROM tt1 ORDER BY user_id DESC LIMIT 1;
 <waiting ...>
step s3-select-distributed-waiting-queries: 
	SELECT blocked_statement, current_statement_in_blocking_process FROM citus_lock_waits WHERE blocked_statement NOT ILIKE '%run_commands_on_session_level_connection_to_node%' AND current_statement_in_blocking_process NOT ILIKE '%run_commands_on_session_level_connection_to_node%';

blocked_statement                                        |current_statement_in_blocking_process
---------------------------------------------------------------------

	SELECT user_id FROM tt1 ORDER BY user_id DESC LIMIT 1;
|
	ALTER TABLE tt1 ADD COLUMN new_column INT;

(1 row)

step s5-rollback:
	ROLLBACK;

step s6-select: <... completed>
user_id
---------------------------------------------------------------------
      7
(1 row)

citus_remove_node
---------------------------------------------------------------------

(1 row)


starting permutation: s8-begin s8-select s7-alter s3-select-distributed-waiting-queries s3-show-actual-gpids s8-rollback
step s8-begin:
	BEGIN;

step s8-select:
	SELECT user_id FROM tt1 ORDER BY user_id DESC LIMIT 1;

user_id
---------------------------------------------------------------------
      7
(1 row)

step s7-alter:
	ALTER TABLE tt1 ADD COLUMN new_column INT;
 <waiting ...>
step s3-select-distributed-waiting-queries: 
	SELECT blocked_statement, current_statement_in_blocking_process FROM citus_lock_waits WHERE blocked_statement NOT ILIKE '%run_commands_on_session_level_connection_to_node%' AND current_statement_in_blocking_process NOT ILIKE '%run_commands_on_session_level_connection_to_node%';

blocked_statement                            |current_statement_in_blocking_process
---------------------------------------------------------------------

	ALTER TABLE tt1 ADD COLUMN new_column INT;
|
	SELECT user_id FROM tt1 ORDER BY user_id DESC LIMIT 1;

(1 row)

step s3-show-actual-gpids:
	SELECT global_pid > 0 as gpid_exists, query FROM citus_stat_activity WHERE state = 'active' AND query IN (SELECT blocked_statement FROM citus_lock_waits UNION SELECT current_statement_in_blocking_process FROM citus_lock_waits) ORDER BY 1 DESC;

gpid_exists|query
---------------------------------------------------------------------
t          |
	ALTER TABLE tt1 ADD COLUMN new_column INT;

(1 row)

step s8-rollback:
	ROLLBACK;

step s7-alter: <... completed>
citus_remove_node
---------------------------------------------------------------------

(1 row)

