diff options
| author | Michael Paquier | 2025-01-17 04:27:39 +0000 |
|---|---|---|
| committer | Michael Paquier | 2025-01-17 04:27:39 +0000 |
| commit | a6c70f68cdeb3bed591a2dd7d421bf3536ba5216 (patch) | |
| tree | 509218b67c1eb4edd0fb97dde8697e1632ceec0b /src/test | |
| parent | 0dc9c7d200e59b19b2e683f78afa1ee4cfcf3c21 (diff) | |
Revert recent changes related to handling of 2PC files at recovery
This commit reverts 8f67f994e8ea (down to v13) and c3de0f9eed38 (down to
v17), as these are proving to not be completely correct regarding two
aspects:
- In v17 and newer branches, c3de0f9eed38's check for epoch handling is
incorrect, and does not correctly handle frozen epochs. A logic closer
to widen_snapshot_xid() should be used. The 2PC code should try to
integrate deeper with FullTransactionIds, 5a1dfde8334b being not enough.
- In v13 and newer branches, 8f67f994e8ea is a workaround for the real
issue, which is that we should not attempt CLOG lookups without reaching
consistency. This exists since 728bd991c3c4, and this is reachable with
ProcessTwoPhaseBuffer() called by restoreTwoPhaseData() at the beginning
of recovery.
Per discussion with Noah Misch.
Discussion: https://postgr.es/m/20250116010051.f3.nmisch@google.com
Backpatch-through: 13
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/recovery/t/009_twophase.pl | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/src/test/recovery/t/009_twophase.pl b/src/test/recovery/t/009_twophase.pl index cf61a2f3285..1a662ebe499 100644 --- a/src/test/recovery/t/009_twophase.pl +++ b/src/test/recovery/t/009_twophase.pl @@ -572,38 +572,4 @@ my $nsubtrans = $cur_primary->safe_psql('postgres', ); isnt($osubtrans, $nsubtrans, "contents of pg_subtrans/ have changed"); -############################################################################### -# Check handling of orphaned 2PC files at recovery. -############################################################################### - -$cur_standby->teardown_node; -$cur_primary->teardown_node; - -# Grab location in logs of primary -my $log_offset = -s $cur_primary->logfile; - -# Create fake files with a transaction ID large or low enough to be in the -# future or the past, in different epochs, then check that the primary is able -# to start and remove these files at recovery. - -# First bump the epoch with pg_resetwal. -$cur_primary->command_ok( - [ 'pg_resetwal', '-e', 256, '-f', $cur_primary->data_dir ], - 'bump epoch of primary'); - -my $future_2pc_file = - $cur_primary->data_dir . '/pg_twophase/000001FF00000FFF'; -append_to_file $future_2pc_file, ""; -my $past_2pc_file = $cur_primary->data_dir . '/pg_twophase/000000EE00000FFF'; -append_to_file $past_2pc_file, ""; - -$cur_primary->start; -$cur_primary->log_check( - "two-phase files removed at recovery", - $log_offset, - log_like => [ - qr/removing past two-phase state file of epoch 238 for transaction 4095/, - qr/removing future two-phase state file of epoch 511 for transaction 4095/ - ]); - done_testing(); |
