Re: Speedup twophase transactions

Stas Kelvich <s.kelvich@postgrespro.ru>

From: Stas Kelvich <s.kelvich@postgrespro.ru>
To: Michael Paquier <michael.paquier@gmail.com>
Cc: Simon Riggs <simon@2ndquadrant.com>, PostgreSQL mailing lists <pgsql-hackers@postgresql.org>, Jesper Pedersen <jesper.pedersen@redhat.com>, Robert Haas <robertmhaas@gmail.com>
Date: 2016-09-06T09:49:53Z
Lists: pgsql-hackers
> On 06 Sep 2016, at 12:09, Simon Riggs <simon@2ndquadrant.com> wrote:
> 
> On 6 September 2016 at 09:58, Stas Kelvich <s.kelvich@postgrespro.ru> wrote:
>> 
>> I'll check it against my failure scenario with subtransactions and post results or updated patch here.
> 
> Make sure tests are added for that. It would have been better to say
> you knew there were bugs in it earlier.

I’ve spotted that yesterday during rebase. Sorry. Next time in same situation i’ll write right away
to save everyone’s time.

> On 06 Sep 2016, at 12:03, Michael Paquier <michael.paquier@gmail.com> wrote:
> 
> On Tue, Sep 6, 2016 at 5:58 PM, Stas Kelvich <s.kelvich@postgrespro.ru> wrote:
>> Oh, I was preparing new version of patch, after fresh look on it. Probably, I should
>> said that in this topic. I’ve found a bug in sub transaction handling and now working
>> on fix.
> 
> What's the problem actually?

Handling of xids_p array in PrescanPreparedTransactions() is wrong for prepared tx's in memory.

Also I want to double-check and add comments to RecoveryInProgress() checks in FinishGXact.

I’ll post reworked patch in several days.

-- 
Stas Kelvich
Postgres Professional: http://www.postgrespro.com
Russian Postgres Company




Commits

  1. Speedup 2PC recovery by skipping two phase state files in normal path

  2. Add tests for two-phase commit

  3. Improve grammar of message about two-phase state files.

  4. Speedup 2PC by skipping two phase state files in normal path