Re: StandbyRecoverPreparedTransactions recovers subtrans links incorrectly
Simon Riggs <simon@2ndquadrant.com>
From: Simon Riggs <simon@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2017-04-25T19:53:58Z
Lists: 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
Commits
-
Rework handling of subtransactions in 2PC recovery
- 49e928154978 10.0 landed
-
Fix order of arguments to SubTransSetParent().
- f5885488dacb 9.6.3 landed
- 0874d4f3e183 10.0 landed
- 952e33b05275 9.2.21 landed
- a66e01bbcc88 9.5.7 landed
- 8565808733ec 9.3.17 landed
- 2e14541c4992 9.4.12 landed
-
Speedup 2PC recovery by skipping two phase state files in normal path
- 728bd991c3c4 10.0 cited