Re: 9.5rc1 brin_summarize_new_values - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: 9.5rc1 brin_summarize_new_values
Date
Msg-id CAB7nPqQcqUCBz8-ayodm9PmxT2uSQBZyPUDW=BN8Unn8NYE9pw@mail.gmail.com
Whole thread Raw
In response to Re: 9.5rc1 brin_summarize_new_values  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Sun, Dec 27, 2015 at 1:27 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Michael Paquier <michael.paquier@gmail.com> writes:
>> On Sat, Dec 26, 2015 at 7:10 AM, Jeff Janes <jeff.janes@gmail.com> wrote:
>> What do you think about the attached?
>
> Don't like that as-is, because dropping and re-acquiring the index lock
> presents a race condition: the checks you made might not apply anymore.
> Admittedly, the odds of a problem are very small, but it's still an
> insecure coding pattern.
>
> I hesitate to produce code without having consumed any caffeine yet,
> but maybe we could do it like this:
>
> [...]

I see, thanks! The lesson is learnt.
-- 
Michael



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: oldest/newestCommitTs output by pg_controldata
Next
From: Jeff Janes
Date:
Subject: Re: WIP: Covering + unique indexes.