Re: Avoiding deadlock errors in CREATE INDEX CONCURRENTLY

From: "Goel, Dhruv" <goeldhru(at)amazon(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Andres Freund <andres(at)anarazel(dot)de>
Cc: Kuntal Ghosh <kuntalghosh(dot)2007(at)gmail(dot)com>
Subject: Re: Avoiding deadlock errors in CREATE INDEX CONCURRENTLY
Date: 2019-06-10 20:22:16
Message-ID: F0162FD7-39F7-4FE2-B94E-2D170B3F0DF8@amazon.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


> On Jun 9, 2019, at 5:33 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Andres Freund <andres(at)anarazel(dot)de> writes:
>> On June 9, 2019 8:36:37 AM PDT, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>> I think you are mistaken that doing transactional updates in pg_index
>>> is OK. If memory serves, we rely on xmin of the pg_index row for
>>> purposes such as detecting whether a concurrently-created index is safe
>>> to use yet.

I took a deeper look regarding this use case but was unable to find more evidence. As part of this patch, we essentially make concurrently-created index safe to use only if transaction started after the xmin of Phase 3. Even today concurrent indexes can not be used for transactions before this xmin because of the wait (which I am trying to get rid of in this patch), is there any other denial of service you are talking about? Both the other states indislive, indisready can be transactional updates as far as I understand. Is there anything more I am missing here?

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashwin Agrawal 2019-06-10 20:48:54 Re: heapam_index_build_range_scan's anyvisible
Previous Message Alvaro Herrera 2019-06-10 19:46:48 Re: tableam: abstracting relation sizing code