Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 68cb5af

Browse files
committed
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
1 parent 0d369ac commit 68cb5af

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/backend/access/transam/xlog.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -5689,7 +5689,11 @@ StartupXLOG(void)
56895689
TrimCLOG();
56905690
TrimMultiXact();
56915691

5692-
/* Reload shared-memory state for prepared transactions */
5692+
/*
5693+
* Reload shared-memory state for prepared transactions. This needs to
5694+
* happen before renaming the last partial segment of the old timeline as
5695+
* it may be possible that we have to recovery some transactions from it.
5696+
*/
56935697
RecoverPreparedTransactions();
56945698

56955699
/* Shut down xlogreader */

src/test/recovery/t/009_twophase.pl

+3-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ sub configure_and_reload
3232

3333
# Setup london node
3434
my $node_london = PostgreSQL::Test::Cluster->new("london");
35-
$node_london->init(allows_streaming => 1);
35+
# Archiving is used to provide coverage with the creation of .partial segments
36+
# done at the end of recovery and the recovery of two-phase transactions.
37+
$node_london->init(allows_streaming => 1, has_archiving => 1);
3638
$node_london->append_conf(
3739
'postgresql.conf', qq(
3840
max_prepared_transactions = 10

0 commit comments

Comments
 (0)