Re: btree vacuum and suspended scans can deadlock - Mailing list pgsql-hackers

From Robert Haas
Subject Re: btree vacuum and suspended scans can deadlock
Date
Msg-id CA+TgmoaNOwr_Vh3Y=v+kMJcETRhHH39D+5E3jNT0Hv_-VdiGmg@mail.gmail.com
Whole thread Raw
In response to btree vacuum and suspended scans can deadlock  (Amit Kapila <amit.kapila16@gmail.com>)
Responses Re: btree vacuum and suspended scans can deadlock  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: btree vacuum and suspended scans can deadlock  (Amit Kapila <amit.kapila16@gmail.com>)
List pgsql-hackers
On Thu, Oct 13, 2016 at 6:33 AM, Amit Kapila <amit.kapila16@gmail.com> wrote:
> If we agree that above is a problematic case, then some of the options
> to solve it could be (a) Vacuum should not wait for a cleanup lock and
> instead just give up and start again which I think is a bad idea (b)
> don't allow to take lock of higher granularity after the scan is
> suspended, not sure if that is feasible (c) document the above danger,
> this sounds okay on the ground that nobody has reported the problem
> till now

I don't think any of these sound particularly good.  There have been
some previous discussions of this topic.

https://wiki.postgresql.org/wiki/Todo#Locking - second and third items
https://www.postgresql.org/message-id/CA+TgmoZG01uGL2TV6KOjmax-53eT3J66nk1KSkuOsPysz=DQ2A@mail.gmail.com

https://www.postgresql.org/message-id/flat/CA%2BU5nMJde1%2Bh5bKm48%2B_4U%3D78%2Bw%2BRa4ipfJnAva6QVyDWv0VNQ%40mail.gmail.com
https://www.postgresql.org/message-id/1223.1298392493@sss.pgh.pa.us

I thought Tom had at some point suggested a way of detecting deadlocks
of this type, but I can't find any such email now.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: emergency outage requiring database restart
Next
From: Tom Lane
Date:
Subject: Re: btree vacuum and suspended scans can deadlock