=== Applying patches on top of PostgreSQL commit ID 71379663fe25aa90049726e913f48daa30a03ff0 === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Fri Jan 16 14:02:20 UTC 2026 On branch cf/6279 nothing to commit, working tree clean === using 'git am' to apply patch ./v4-0001-Check-presence-of-REDO-record.patch === Applying: Check presence of REDO record Using index info to reconstruct a base tree... M src/backend/access/transam/xlog.c M src/backend/access/transam/xlogrecovery.c M src/test/recovery/meson.build Falling back to patching base and 3-way merge... CONFLICT (add/add): Merge conflict in src/test/recovery/t/050_redo_segment_missing.pl Auto-merging src/test/recovery/t/050_redo_segment_missing.pl Auto-merging src/test/recovery/meson.build CONFLICT (content): Merge conflict in src/test/recovery/meson.build Auto-merging src/backend/access/transam/xlogrecovery.c Auto-merging src/backend/access/transam/xlog.c error: Failed to merge in the changes. hint: Use 'git am --show-current-patch=diff' to see the failed patch Patch failed at 0001 Check presence of REDO record When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort". Unstaged changes after reset: M src/test/recovery/meson.build M src/test/recovery/t/050_redo_segment_missing.pl === using patch(1) to apply patch ./v4-0001-Check-presence-of-REDO-record.patch === patching file src/backend/access/transam/xlog.c Hunk #1 succeeded at 7027 with fuzz 2 (offset 26 lines). Hunk #2 succeeded at 7218 with fuzz 2 (offset 63 lines). patching file src/backend/access/transam/xlogrecovery.c Hunk #1 FAILED at 805. 1 out of 1 hunk FAILED -- saving rejects to file src/backend/access/transam/xlogrecovery.c.rej patching file src/test/recovery/meson.build Hunk #1 FAILED at 58. 1 out of 1 hunk FAILED -- saving rejects to file src/test/recovery/meson.build.rej The next patch would create the file src/test/recovery/t/050_redo_segment_missing.pl, which already exists! Skipping patch. 1 out of 1 hunk ignored Unstaged changes after reset: M src/backend/access/transam/xlog.c Removing src/backend/access/transam/xlogrecovery.c.rej Removing src/test/recovery/meson.build.rej === using 'git apply' to apply patch ./v4-0001-Check-presence-of-REDO-record.patch === Applied patch to 'src/backend/access/transam/xlog.c' cleanly. Applied patch to 'src/backend/access/transam/xlogrecovery.c' cleanly. Applied patch to 'src/test/recovery/meson.build' with conflicts. Performing three-way merge... Applied patch to 'src/test/recovery/t/050_redo_segment_missing.pl' with conflicts. U src/test/recovery/meson.build U src/test/recovery/t/050_redo_segment_missing.pl diff --cc src/test/recovery/meson.build index 8d20488952e,e93248bd66e..00000000000 --- a/src/test/recovery/meson.build +++ b/src/test/recovery/meson.build @@@ -59,7 -59,6 +59,10 @@@ tests += 't/048_vacuum_horizon_floor.pl', 't/049_wait_for_lsn.pl', 't/050_redo_segment_missing.pl', ++<<<<<<< ours + 't/051_effective_wal_level.pl', ++======= ++>>>>>>> theirs ], }, } diff --cc src/test/recovery/t/050_redo_segment_missing.pl index e07ff0c72fe,113477e0152..00000000000 --- a/src/test/recovery/t/050_redo_segment_missing.pl +++ b/src/test/recovery/t/050_redo_segment_missing.pl @@@ -1,4 -1,4 +1,8 @@@ ++<<<<<<< ours +# Copyright (c) 2025-2026, PostgreSQL Global Development Group ++======= + # Copyright (c) 2025, PostgreSQL Global Development Group ++>>>>>>> theirs # # Evaluates PostgreSQL's recovery behavior when a WAL segment containing the # redo record is missing, with a checkpoint record located in a different @@@ -29,16 -29,16 +33,29 @@@ if (!$node->check_extension('injection_ } $node->safe_psql('postgres', q(CREATE EXTENSION injection_points)); ++<<<<<<< ours +# Note that this uses two injection points based on waits, not one. This +# may look strange, but this works as a workaround to enforce all memory +# allocations to happen outside the critical section of the checkpoint +# required for this test. +# First, "create-checkpoint-initial" is run outside the critical section +# section, and is used as a way to initialize the shared memory required +# for the wait machinery with its DSM registry. +# Then, "create-checkpoint-run" is loaded outside the critical section of +# a checkpoint to allocate any memory required by the library load, and +# its callback is run inside the critical section. ++======= + # Note that this uses two injection points based on waits, not one. + # This may look strange, but this works as a workaround to enforce + # all memory allocations to happen outside the critical section of a + # checkpoint. + # First, "create-checkpoint-initial" is run outside the critical + # section, and is used as a way to initialize the shared memory required + # for the wait machinery with its DSM registry. + # Then, "create-checkpoint-run" is run inside the critical section of + # a checkpoint, with its callback loaded outside its critical section to + # allocate any memory required by the callback. ++>>>>>>> theirs $node->safe_psql('postgres', q{select injection_points_attach('create-checkpoint-initial', 'wait')}); $node->safe_psql('postgres', @@@ -54,20 -54,20 +71,34 @@@ $checkpoint->query_until checkpoint; )); ++<<<<<<< ours +# Wait for the initial point to finish, the checkpointer is still ++======= + # Wait for initialization point to finish, the checkpointer is still ++>>>>>>> theirs # outside its critical section. Then release to reach the second # point. $node->wait_for_event('checkpointer', 'create-checkpoint-initial'); $node->safe_psql('postgres', q{select injection_points_wakeup('create-checkpoint-initial')}); ++<<<<<<< ours +# Wait until the checkpoint has reached the second injection point. +# We are now in the middle of a checkpoint running, after the redo +# record has been logged. +$node->wait_for_event('checkpointer', 'create-checkpoint-run'); + +# Switch the WAL segment, ensuring that the redo record will be included +# in a different segment than the checkpoint record. ++======= + # Wait until the checkpoint has reached the second injection point, + # we are now in the middle of a checkpoint running after the redo + # record has been logged. + $node->wait_for_event('checkpointer', 'create-checkpoint-run'); + + # Switch the WAL segment, ensuring that the redo record will be + # included in a different segment than the checkpoint record. ++>>>>>>> theirs $node->safe_psql('postgres', 'SELECT pg_switch_wal()'); # Continue the checkpoint and wait for its completion. @@@ -94,12 -94,12 +125,21 @@@ isnt($redo_walfile_name, $checkpoint_wa # Remove the WAL segment containing the redo record. unlink $node->data_dir . "/pg_wal/$redo_walfile_name" ++<<<<<<< ours + or die "could not remove WAL file: $!"; + +$node->stop('immediate'); + +# Use run_log instead of node->start because this test expects that +# the server ends with an error during recovery. ++======= + or die "Could not remove WAL file: $!"; + + $node->stop('immediate'); + + # Use run_log instead of node->start because this test expects + # that the server ends with an error during recovery. ++>>>>>>> theirs run_log( [ 'pg_ctl', @@@ -111,7 -111,7 +151,11 @@@ # Confirm that recovery has failed, as expected. my $logfile = slurp_file($node->logfile()); ok( $logfile =~ ++<<<<<<< ours + qr/FATAL: .* could not find redo location .* referenced by checkpoint record at .*/, ++======= + qr/FATAL: could not find redo location .* referenced by checkpoint record at .*/, ++>>>>>>> theirs "ends with FATAL because it could not find redo location"); done_testing();