Re: BUG #15290: Stuck Parallel Index Scan query

Thomas Munro <thomas.munro@enterprisedb.com>

From: Thomas Munro <thomas.munro@enterprisedb.com>
To: Victor Yegorov <vyegorov@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2018-07-25T02:04:11Z
Lists: pgsql-bugs
Ok, I see it:

                        /* check for interrupts while we're not
holding any buffer lock */
                        CHECK_FOR_INTERRUPTS();
                        /* step right one page */
                        so->currPos.buf = _bt_getbuf(rel, blkno, BT_READ);
                        ...
                        /* nope, keep going */
                        if (scan->parallel_scan != NULL)
                        {
                                status = _bt_parallel_seize(scan, &blkno);

That leads to a condition variable wait, while we still hold that
buffer lock.  That prevents interrupts.  Oops.

-- 
Thomas Munro
http://www.enterprisedb.com


Commits

  1. Fix the buffer release order for parallel index scans.