Re: [HACKERS] StandbyRecoverPreparedTransactions recovers subtranslinks incorrectly - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: [HACKERS] StandbyRecoverPreparedTransactions recovers subtranslinks incorrectly
Date
Msg-id CANP8+j+1bQKWiBQyT7H4Hpoe_Cj0em7DN91sbgX1UapTdk2K2g@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] StandbyRecoverPreparedTransactions recovers subtrans links incorrectly  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] StandbyRecoverPreparedTransactions recovers subtranslinks incorrectly  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers
On 25 April 2017 at 16:28, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Simon Riggs <simon@2ndquadrant.com> writes:
>> I can't see any reason now why overwriteOK should exist at all. I'm
>> guessing that the whole "overwriteOK" idea was an incorrect response
>> to xids appearing where they shouldn't have done because of the
>> mistake you just corrected. So I will now remove the parameter from
>> the call.
>
> Seems reasonable, but I don't like the logic change you made in
> SubTransSetParent; you broke the former invariant, for non-Assert
> builds, that the target pg_subtrans entry is guaranteed to have
> the correct value on exit.  I do like fixing it to not dirty the
> page unnecessarily, but I'd suggest that we write it like
>
>         if (*ptr != parent)
>         {
>                 Assert(*ptr == InvalidTransactionId);
>                 *ptr = parent;
>                 SubTransCtl->shared->page_dirty[slotno] = true;
>         }

OK, thanks. I'll commit that tomorrow.

-- 
Simon Riggs                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: [HACKERS] scram and \password
Next
From: Simon Riggs
Date:
Subject: Re: [HACKERS] StandbyRecoverPreparedTransactions recovers subtranslinks incorrectly