=== Applying patches on top of PostgreSQL commit ID 901ed9b352b41f034e17bc540725082a488fce31 === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Sun May 10 11:56:21 UTC 2026 On branch cf/6605 nothing to commit, working tree clean === using 'git am' to apply patch ./0001-Mark-modified-FSM-buffer-as-dirty-during-recovery.patch === Applying: Mark modified FSM buffer as dirty during recovery. Using index info to reconstruct a base tree... M src/backend/storage/freespace/freespace.c Falling back to patching base and 3-way merge... Auto-merging src/backend/storage/freespace/freespace.c CONFLICT (content): Merge conflict in src/backend/storage/freespace/freespace.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 Mark modified FSM buffer as dirty during recovery. 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". === using patch(1) to apply patch ./0001-Mark-modified-FSM-buffer-as-dirty-during-recovery.patch === patching file src/backend/storage/freespace/freespace.c Hunk #1 FAILED at 231. 1 out of 1 hunk FAILED -- saving rejects to file src/backend/storage/freespace/freespace.c.rej Removing src/backend/storage/freespace/freespace.c.rej === using 'git apply' to apply patch ./0001-Mark-modified-FSM-buffer-as-dirty-during-recovery.patch === Applied patch to 'src/backend/storage/freespace/freespace.c' with conflicts. U src/backend/storage/freespace/freespace.c diff --cc src/backend/storage/freespace/freespace.c index 006edab9d77,1631bc79872..00000000000 --- a/src/backend/storage/freespace/freespace.c +++ b/src/backend/storage/freespace/freespace.c @@@ -232,14 -232,14 +232,25 @@@ XLogRecordPageWithFreeSpace(RelFileLoca PageInit(page, BLCKSZ, 0); /* ++<<<<<<< ours + * Changes to FSM are usually marked as changed using MarkBufferDirtyHint; + * however, during recovery, it does nothing if checksums are enabled. It + * is assumed that the page should not be dirtied during recovery while + * modifying hints to prevent torn pages, since no new WAL data can be + * generated at this point to store FPI. This is not relevant to the FSM + * case, as its blocks are zeroed when a checksum mismatch occurs. So, we + * need to use regular MarkBufferDirty here to mark the FSM block as + * modified during recovery, otherwise changes to the FSM may be lost. ++======= + * Changes to FSM are usually marked as changed using MarkBufferDirtyHint, + * however during recovery it does nothing if checksums are enabled. It is + * assumed that page should not be dirtied during recovery while modifying + * hints to protect from torn pages as no new WAL data could be generated + * at this point to store FPI. This is not relevant for the FSM case, as + * its blocks are just zeroed in case of checksum mismatch. So, we need to + * use regular MarkBufferDirty here to actually mark FSM block as modified + * during the recovery, otherwise changes to the FSM may be just lost. ++>>>>>>> theirs */ if (fsm_set_avail(page, slot, new_cat)) MarkBufferDirty(buf);