Re: Speedup twophase transactions

From: Nikhil Sontakke <nikhils(at)2ndquadrant(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Stas Kelvich <s(dot)kelvich(at)postgrespro(dot)ru>, Simon Riggs <simon(at)2ndquadrant(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>, Jesper Pedersen <jesper(dot)pedersen(at)redhat(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: Speedup twophase transactions
Date: 2017-02-02 06:07:20
Views: Raw Message | Whole Thread | Download mbox
Lists: pgsql-hackers

>> Yeah. Was thinking about this yesterday. How about adding entries in
>> TwoPhaseState itself (which become valid later)? Only if it does not
>> cause a lot of code churn.
> That's possible as well, yes.

PFA a patch which does the above. It re-uses the TwoPhaseState gxact
entries to track 2PC PREPARE/COMMIT in shared memory. The advantage
being that CheckPointTwoPhase() becomes the only place where the fsync
of 2PC files happens.

A minor annoyance in the patch is the duplication of the code to add
the 2nd while loop to go through these shared memory entries in
PrescanPreparedTransactions, RecoverPreparedTransactions and

Other than this, I ran TAP tests and they succeed as needed.

Nikhil Sontakke
PostgreSQL Development, 24x7 Support, Training & Services

Attachment Content-Type Size
twophase_recovery_shmem_020217.patch application/octet-stream 33.0 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2017-02-02 06:34:33 Re: [BUGS] Bug in Physical Replication Slots (at least 9.5)?
Previous Message Higuchi, Daisuke 2017-02-02 06:01:55 Re: [Bug fix] PQsendQuery occurs error when target_session_attrs is set to read-write