pgsql: Treat 2PC commit/abort the same as regular xacts in recovery.

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Treat 2PC commit/abort the same as regular xacts in recovery.
Date: 2014-07-29 09:02:55
Message-ID: E1XC3J9-0001cG-5Y@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Treat 2PC commit/abort the same as regular xacts in recovery.

There were several oversights in recovery code where COMMIT/ABORT PREPARED
records were ignored:

* pg_last_xact_replay_timestamp() (wasn't updated for 2PC commits)
* recovery_min_apply_delay (2PC commits were applied immediately)
* recovery_target_xid (recovery would not stop if the XID used 2PC)

The first of those was reported by Sergiy Zuban in bug #11032, analyzed by
Tom Lane and Andres Freund. The bug was always there, but was masked before
commit d19bd29f07aef9e508ff047d128a4046cc8bc1e2, because COMMIT PREPARED
always created an extra regular transaction that was WAL-logged.

Backpatch to all supported versions (older versions didn't have all the
features and therefore didn't have all of the above bugs).

Branch
------
REL9_2_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/1578d13dc76d8e40cb0ef04d525af406357bd57d

Modified Files
--------------
src/backend/access/transam/xlog.c | 32 ++++++++++++++++++++++++++++----
src/include/access/xact.h | 3 +--
2 files changed, 29 insertions(+), 6 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2014-07-29 14:10:02 Re: pgsql: Treat 2PC commit/abort the same as regular xacts in recovery.
Previous Message Fujii Masao 2014-07-29 03:27:10 pgsql: Reword the sentence for pg_logical_slot_peek_changes function.