pgsql: Revert recent changes related to handling of 2PC files at recove

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Revert recent changes related to handling of 2PC files at recove
Date: 2025-01-17 04:28:18
Message-ID: E1tYdxy-0021Cz-Dq@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Revert recent changes related to handling of 2PC files at recovery

This commit reverts 8f67f994e8ea (down to v13) and c3de0f9eed38 (down to
v17), as these are proving to not be completely correct regarding two
aspects:
- In v17 and newer branches, c3de0f9eed38's check for epoch handling is
incorrect, and does not correctly handle frozen epochs. A logic closer
to widen_snapshot_xid() should be used. The 2PC code should try to
integrate deeper with FullTransactionIds, 5a1dfde8334b being not enough.
- In v13 and newer branches, 8f67f994e8ea is a workaround for the real
issue, which is that we should not attempt CLOG lookups without reaching
consistency. This exists since 728bd991c3c4, and this is reachable with
ProcessTwoPhaseBuffer() called by restoreTwoPhaseData() at the beginning
of recovery.

Per discussion with Noah Misch.

Discussion: https://postgr.es/m/20250116010051.f3.nmisch@google.com
Backpatch-through: 13

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/d1bf86a6221177248669db56f9572bae5add026d

Modified Files
--------------
src/backend/access/transam/twophase.c | 175 +++++++++++-----------------------
src/test/recovery/t/009_twophase.pl | 34 -------
2 files changed, 55 insertions(+), 154 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2025-01-17 07:29:09 pgsql: Add pg_nodiscard decorations to base64 functions
Previous Message Nathan Bossart 2025-01-17 02:55:47 pgsql: Remove redefinitions of SIG_* macros in win32_port.h.