Reorder actions in ProcArrayApplyRecoveryInfo()
Alexander Korotkov <akorotkov@postgresql.org>
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
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/storage/ipc/procarray.c | modified | +11 −5 |
Discussion
- XID formatting and SLRU refactorings (was: Add 64-bit XIDs into PostgreSQL 15) 149 messages · 2022-03-17 → 2024-08-19
- Assertion failure with epoch when replaying standby records for 2PC 3 messages · 2024-01-17 → 2024-01-19