pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Korotkov <akorotkov@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Reorder actions in ProcArrayApplyRecoveryInfo()
Date: Fri, 19 Jan 2024 15:19:24 +0000
Message-ID: <E1rQqeS-002A0s-Qm@gemulon.postgresql.org> (raw)

Reorder actions in ProcArrayApplyRecoveryInfo()

Since 5a1dfde8334b, 2PC filenames use FullTransactionId.  Thus, it needs to
convert TransactionId to FullTransactionId in StandbyTransactionIdIsPrepared()
using TransamVariables->nextXid.  However, ProcArrayApplyRecoveryInfo()
first releases locks with usage StandbyTransactionIdIsPrepared(), then advances
TransamVariables->nextXid.  This sequence of actions could cause errors.
This commit makes ProcArrayApplyRecoveryInfo() advance
TransamVariables->nextXid before releasing locks.

Reported-by: Thomas Munro, Michael Paquier
Discussion: https://postgr.es/m/CA%2BhUKGLj_ve1_pNAnxwYU9rDcv7GOhsYXJt7jMKSA%3D5-6ss-Cw%40mail.gmail.com
Discussion: https://postgr.es/m/Zadp9f4E1MYvMJqe%40paquier.xyz

Branch
------
master

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

Modified Files
--------------
src/backend/storage/ipc/procarray.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)



view thread (3+ messages)  latest in thread

Message-ID: <E1rQqeS-002A0s-Qm@gemulon.postgresql.org>
Permalink:  ../E1rQqeS-002A0s-Qm@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1rQqeS-002A0s-Qm@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: akorotkov@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Reorder actions in ProcArrayApplyRecoveryInfo()
  In-Reply-To: <E1rQqeS-002A0s-Qm@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox