On Fri, Apr 6, 2018 at 12:23 AM, Nikhil Sontakke
<nikh...@2ndquadrant.com> wrote:
> Hi,
>
>
>
>>> Uh? Simply rechecking if MyProc->decodeGroupLeader is NULL obviously
>>> does not fix the race condition - it might get NULL right after the
>>> check. So we need to either lookup the PROC again (and then get the
>>> associated lwlock), or hold some other type of lock.
>>>
>>
>> I realized my approach was short-sighted while coding it up. So now we
>> lookup the leader pgproc, recheck if the XID is the same that we are
>> interested in and go ahead.
>>
>
> I did some more gdb single-stepping and debugging on this. Introduced a few
> more fetch pgproc using XID calls for more robustness. I am satisfied now from
> my point of view with the decodegroup lock changes.
>
> Also a few other changes related to cleanups and setting of the txn flags at
> all places.
>
> PFA, v2.0 of the patchset for today.
>
> "make check-world" passes ok on these patches.
>


OK, I think this is now committable. The changes are small, fairly
isolated in effect, and I think every objection has been met, partly
by reducing the scope of the changes. By committing this we will allow
plugin authors to start developing 2PC support, which is important in
some use cases.

I therefore intent to commit these patches some time before the
deadline, either in 12 hours or so, or about 24 hours after that
(which would be right up against the deadline by my calculation) ,
depending on some other important obligations I have.

cheers

andrew

-- 
Andrew Dunstan                https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Reply via email to