If the attached test patch is applied (no code changes) to master, and
the "amcheck" target is run with debug_parallel_query = regress, I see
the following stuck query:
# select
application_name,
now() - state_change AS duration,
wait_event_type,
wait_event,
state,
query
from pg_stat_activity
where pid<>pg_backend_pid() and backend_type='client backend';
application_name | 004_verify_nbtree_unique.pl
duration | 00:12:29.456255
wait_event_type | IPC
wait_event | ParallelFinish
state | active
query | DELETE FROM bttest_unique3 WHERE 380 <= i
AND i <= 420;
I found this while fixing a parallel query problem with 2af07e2f74, but
the problem can be observed on an earlier version of master as well
(2c29e7fc95) so it's unrelated to my change.
I haven't investigated much, but I don't see an explanation other than
a bug. It reproduces on my local machine consistently.
Regards,
Jeff Davis