diff options
author | Michael Paquier <michael@paquier.xyz> | 2023-06-20 10:25:27 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2023-06-20 10:25:27 +0900 |
commit | 68cb5af46cd8bb2f6fd25886da5d6045a6a42208 (patch) | |
tree | a4a4dee186a84ca594bc4d3860d639c60ccdefcc /src/backend/access/transam/xlog.c | |
parent | 0d369ac650041862ed5006885160f36d24b224a4 (diff) | |
download | postgresql-68cb5af46cd8bb2f6fd25886da5d6045a6a42208.tar.gz postgresql-68cb5af46cd8bb2f6fd25886da5d6045a6a42208.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.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index b2430f617c0..8b0710abe60 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -5689,7 +5689,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 */ |