Re: Slow catchup of 2PC (twophase) transactions on replica in LR

From: Давыдов Виталий <v(dot)davydov(at)postgrespro(dot)ru>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Slow catchup of 2PC (twophase) transactions on replica in LR
Date: 2024-02-29 17:34:42
Message-ID: cedbe-65e0c000-1-6db17700@133269862
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Dear All,

Consider, please, my patch for async commit for twophase transactions. It can be applicable when catchup performance is not enought with publication parameter twophase = on.

The key changes are:
* Use XLogSetAsyncXactLSN instead of XLogFlush as it is for usual transactions. * In case of async commit only, save 2PC state in the pg_twophase file (but not fsync it) in addition to saving in the WAL. The file is used as an alternative to storing 2pc state in the memory. * On recovery, reject pg_twophase files with future xids.Probably, 2PC async commit should be enabled by a GUC (not implemented in the patch).

With best regards,


Attachment Content-Type Size
0001-Async-commit-support-for-twophase-transactions.patch text/x-patch 11.6 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Bharath Rupireddy 2024-02-29 18:11:45 Re: Atomic ops for unlogged LSN
Previous Message Tom Lane 2024-02-29 17:04:27 Re: Fix for edge case in date_bin() function