aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/transam/xlog.c
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2023-06-20 10:25:41 +0900
committerMichael Paquier <michael@paquier.xyz>2023-06-20 10:25:41 +0900
commita10be37254fe06ca0d16f34d2fd5933d3adfa66e (patch)
treecb681a259fb886975aed525363c4d53a1ff79e90 /src/backend/access/transam/xlog.c
parent8f2ec8cc7e3de918988a49302dddc64deca16c02 (diff)
downloadpostgresql-a10be37254fe06ca0d16f34d2fd5933d3adfa66e.tar.gz
postgresql-a10be37254fe06ca0d16f34d2fd5933d3adfa66e.zip
Enable archiving in recovery TAP test 009_twophase.pl
This is a follow-up of f663b00, that has been committed to v13 and v14, tweaking the TAP test for two-phase transactions so as it provides coverage for the bug that has been fixed. This change is done in its own commit for clarity, as v15 and HEAD did not show the problematic behavior, still missed coverage for it. While on it, this adds a comment about the dependency of the last partial segment rename and RecoverPreparedTransactions() at the end of recovery, as that can be easy to miss. Author: Michael Paquier Reviewed-by: Kyotaro Horiguchi Discussion: https://postgr.es/m/743b9b45a2d4013bd90b6a5cba8d6faeb717ee34.camel@cybertec.at Backpatch-through: 13
Diffstat (limited to 'src/backend/access/transam/xlog.c')
-rw-r--r--src/backend/access/transam/xlog.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 691b9622dad..59f94b05d4a 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -5544,7 +5544,11 @@ StartupXLOG(void)
TrimCLOG();
TrimMultiXact();
- /* Reload shared-memory state for prepared transactions */
+ /*
+ * Reload shared-memory state for prepared transactions. This needs to
+ * happen before renaming the last partial segment of the old timeline as
+ * it may be possible that we have to recovery some transactions from it.
+ */
RecoverPreparedTransactions();
/* Shut down xlogreader */