@ -6,7 +6,7 @@
# and is incorrectly marked parallel-safe so that it can execute in a worker.
# and is incorrectly marked parallel-safe so that it can execute in a worker.
# Note that we explicitly override any global settings of isolation level
# Note that we explicitly override any global settings of isolation level
# or force_parallel_mode , to ensure we're testing what we intend to.
# or debug_parallel_query , to ensure we're testing what we intend to.
# Otherwise, this is morally equivalent to deadlock-soft.spec:
# Otherwise, this is morally equivalent to deadlock-soft.spec:
# Four-process deadlock with two hard edges and two soft edges.
# Four-process deadlock with two hard edges and two soft edges.
@ -55,13 +55,13 @@ teardown
session d1
session d1
setup { BEGIN isolation level repeatable read;
setup { BEGIN isolation level repeatable read;
SET force_parallel_mode = off;
SET debug_parallel_query = off;
SET deadlock_timeout = '10s';
SET deadlock_timeout = '10s';
}
}
# these locks will be taken in the leader, so they will persist:
# these locks will be taken in the leader, so they will persist:
step d1a1 { SELECT lock_share(1,x), lock_excl(3,x) FROM bigt LIMIT 1; }
step d1a1 { SELECT lock_share(1,x), lock_excl(3,x) FROM bigt LIMIT 1; }
# this causes all the parallel workers to take locks:
# this causes all the parallel workers to take locks:
step d1a2 { SET force_parallel_mode = on;
step d1a2 { SET debug_parallel_query = on;
SET parallel_setup_cost = 0;
SET parallel_setup_cost = 0;
SET parallel_tuple_cost = 0;
SET parallel_tuple_cost = 0;
SET min_parallel_table_scan_size = 0;
SET min_parallel_table_scan_size = 0;
@ -72,21 +72,21 @@ step d1c { COMMIT; }
session d2
session d2
setup { BEGIN isolation level repeatable read;
setup { BEGIN isolation level repeatable read;
SET force_parallel_mode = off;
SET debug_parallel_query = off;
SET deadlock_timeout = '10ms';
SET deadlock_timeout = '10ms';
}
}
# this lock will be taken in the leader, so it will persist:
# this lock will be taken in the leader, so it will persist:
step d2a2 { select lock_share(2,x) FROM bigt LIMIT 1; }
step d2a2 { select lock_share(2,x) FROM bigt LIMIT 1; }
# this causes all the parallel workers to take locks;
# this causes all the parallel workers to take locks;
# after which, make the leader take lock 3 to prevent client-driven deadlock
# after which, make the leader take lock 3 to prevent client-driven deadlock
step d2a1 { SET force_parallel_mode = on;
step d2a1 { SET debug_parallel_query = on;
SET parallel_setup_cost = 0;
SET parallel_setup_cost = 0;
SET parallel_tuple_cost = 0;
SET parallel_tuple_cost = 0;
SET min_parallel_table_scan_size = 0;
SET min_parallel_table_scan_size = 0;
SET parallel_leader_participation = off;
SET parallel_leader_participation = off;
SET max_parallel_workers_per_gather = 3;
SET max_parallel_workers_per_gather = 3;
SELECT sum(lock_share(1,x)) FROM bigt;
SELECT sum(lock_share(1,x)) FROM bigt;
SET force_parallel_mode = off;
SET debug_parallel_query = off;
RESET parallel_setup_cost;
RESET parallel_setup_cost;
RESET parallel_tuple_cost;
RESET parallel_tuple_cost;
SELECT lock_share(3,x) FROM bigt LIMIT 1; }
SELECT lock_share(3,x) FROM bigt LIMIT 1; }
@ -94,7 +94,7 @@ step d2c { COMMIT; }
session e1
session e1
setup { BEGIN isolation level repeatable read;
setup { BEGIN isolation level repeatable read;
SET force_parallel_mode = on;
SET debug_parallel_query = on;
SET deadlock_timeout = '10s';
SET deadlock_timeout = '10s';
}
}
# this lock will be taken in a parallel worker, but we don't need it to persist
# this lock will be taken in a parallel worker, but we don't need it to persist
@ -103,7 +103,7 @@ step e1c { COMMIT; }
session e2
session e2
setup { BEGIN isolation level repeatable read;
setup { BEGIN isolation level repeatable read;
SET force_parallel_mode = on;
SET debug_parallel_query = on;
SET deadlock_timeout = '10s';
SET deadlock_timeout = '10s';
}
}
# this lock will be taken in a parallel worker, but we don't need it to persist
# this lock will be taken in a parallel worker, but we don't need it to persist