Re: SKIP LOCKED DATA (work in progress) - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: SKIP LOCKED DATA (work in progress)
Date
Msg-id CADLWmXXJtq1OsxmrfdNHA9hTLRP+v5mpq5QjxSXF+BeXX+hOow@mail.gmail.com
Whole thread Raw
In response to Re: SKIP LOCKED DATA (work in progress)  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: SKIP LOCKED DATA (work in progress)
List pgsql-hackers
On 25 August 2014 02:57, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
> Thomas Munro wrote:
>> The difficulty of course will be testing all these racy cases reproducibly...
>
> Does this help?
> http://www.postgresql.org/message-id/51FB4305.3070600@2ndquadrant.com
> The useful trick there is forcing a query to get its snapshot and then
> go to sleep before actually doing anything, by way of an advisory lock.

Yes it does, thanks Alvaro and Craig.  I think the attached spec
reproduces the problem using that trick, ie shows NOWAIT blocking,
presumably in EvalPlanQualFetch (though I haven't stepped through it
with a debugger yet).  I'm afraid I'm out of Postgres hacking cycles
for a few days, but next weekend I should have a new patch that fixes
this by teaching EvalPlanQualFetch about wait policies, with isolation
tests for NOWAIT and SKIP LOCKED.

Best regards,
Thomas Munro

Attachment

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Is this a bug?
Next
From: Bruce Momjian
Date:
Subject: Re: Hardening pg_upgrade