=== Applying patches on top of PostgreSQL commit ID bdaad789c843f57b1fc66c5ede7abaff8a915c3b === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Wed Aug 12 23:56:31 UTC 2026 On branch cf/6957 nothing to commit, working tree clean === using 'git am' to apply patch ./v02-0001-Use-tuple-slot-to-pass-tuples-for-rewriting.patch === Applying: Use tuple slot to pass tuples for rewriting. === using 'git am' to apply patch ./v02-0002-Move-functions-to-repack.c.patch === Applying: Move functions to repack.c. === using 'git am' to apply patch ./v02-0003-Introduce-RepackDest-structure.patch === Applying: Introduce RepackDest structure. === using 'git am' to apply patch ./v02-0004-Use-multiple-snapshots-to-copy-the-data.patch === Applying: Use multiple snapshots to copy the data. error: sha1 information is lacking or useless (src/backend/commands/repack.c). error: could not build fake ancestor hint: Use 'git am --show-current-patch=diff' to see the failed patch Patch failed at 0001 Use multiple snapshots to copy the data. 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 ./v02-0004-Use-multiple-snapshots-to-copy-the-data.patch === patching file src/backend/access/heap/heapam_handler.c patching file src/backend/commands/repack.c Hunk #3 succeeded at 135 with fuzz 1. Hunk #7 succeeded at 923 (offset -50 lines). Hunk #8 succeeded at 967 (offset -50 lines). Hunk #9 succeeded at 1004 (offset -50 lines). Hunk #10 succeeded at 1026 (offset -50 lines). Hunk #11 succeeded at 1145 (offset -50 lines). Hunk #12 succeeded at 1317 (offset -50 lines). Hunk #13 succeeded at 1327 (offset -50 lines). Hunk #14 succeeded at 1362 (offset -50 lines). Hunk #15 succeeded at 1421 (offset -50 lines). Hunk #16 succeeded at 1428 (offset -50 lines). Hunk #17 succeeded at 1447 (offset -50 lines). Hunk #18 succeeded at 1551 (offset -50 lines). Hunk #19 succeeded at 1599 (offset -50 lines). Hunk #20 succeeded at 2573 (offset 13 lines). Hunk #21 succeeded at 2587 (offset 13 lines). Hunk #22 succeeded at 2751 (offset 13 lines). Hunk #23 succeeded at 2764 (offset 13 lines). Hunk #24 succeeded at 2804 (offset 13 lines). Hunk #25 succeeded at 2821 (offset 13 lines). Hunk #26 succeeded at 2845 (offset 13 lines). Hunk #27 succeeded at 2889 (offset 13 lines). Hunk #28 succeeded at 3075 (offset 13 lines). Hunk #29 succeeded at 3088 (offset 13 lines). Hunk #30 succeeded at 3096 (offset 13 lines). Hunk #31 succeeded at 3151 (offset 13 lines). Hunk #32 succeeded at 3177 (offset 13 lines). Hunk #33 succeeded at 3310 (offset 13 lines). Hunk #34 succeeded at 3332 (offset 13 lines). Hunk #35 succeeded at 3348 (offset 13 lines). Hunk #36 succeeded at 3489 (offset 13 lines). Hunk #37 succeeded at 3512 (offset 13 lines). Hunk #38 succeeded at 3523 (offset 13 lines). Hunk #39 succeeded at 3549 (offset 13 lines). Hunk #40 succeeded at 3585 (offset 13 lines). Hunk #41 succeeded at 3645 (offset 13 lines). Hunk #42 succeeded at 3698 (offset 13 lines). Hunk #43 succeeded at 3717 (offset 13 lines). Hunk #44 succeeded at 3829 (offset 13 lines). Hunk #45 succeeded at 4059 (offset 13 lines). Hunk #46 succeeded at 4187 (offset 13 lines). Hunk #47 succeeded at 4199 (offset 13 lines). Hunk #48 succeeded at 4213 (offset 13 lines). Hunk #49 succeeded at 4227 (offset 13 lines). Hunk #50 succeeded at 4326 (offset 13 lines). patching file src/backend/commands/repack_worker.c patching file src/backend/replication/logical/decode.c patching file src/backend/replication/logical/logical.c Hunk #1 succeeded at 1748 (offset 89 lines). Hunk #2 succeeded at 1769 (offset 89 lines). patching file src/backend/replication/logical/reorderbuffer.c Hunk #1 succeeded at 3753 (offset 26 lines). Hunk #2 succeeded at 5284 (offset 26 lines). patching file src/backend/replication/logical/snapbuild.c patching file src/backend/replication/pgrepack/pgrepack.c Hunk #2 succeeded at 66 (offset -2 lines). Hunk #3 succeeded at 138 (offset -2 lines). Hunk #4 succeeded at 154 (offset -2 lines). Hunk #5 succeeded at 170 (offset -2 lines). Hunk #6 succeeded at 198 (offset -2 lines). Hunk #7 succeeded at 295 (offset -2 lines). patching file src/backend/utils/misc/guc_parameters.dat Hunk #1 succeeded at 2550 (offset 6 lines). patching file src/backend/utils/misc/guc_tables.c patching file src/include/access/tableam.h Hunk #2 succeeded at 1737 (offset 4 lines). Hunk #3 succeeded at 1749 (offset 4 lines). patching file src/include/commands/repack.h patching file src/include/commands/repack_internal.h patching file src/include/replication/logical.h patching file src/include/replication/reorderbuffer.h patching file src/test/modules/injection_points/Makefile Hunk #1 succeeded at 16 with fuzz 2 (offset 1 line). patching file src/test/modules/injection_points/expected/repack_snapshots.out patching file src/test/modules/injection_points/meson.build Hunk #1 succeeded at 47 with fuzz 2 (offset 1 line). patching file src/test/modules/injection_points/specs/repack_snapshots.spec [cf/6957 9cc4a3b3d45] Use multiple snapshots to copy the data. Author: Antonin Houska Date: Wed Jul 15 10:37:12 2026 +0200 19 files changed, 1906 insertions(+), 298 deletions(-) create mode 100644 src/test/modules/injection_points/expected/repack_snapshots.out create mode 100644 src/test/modules/injection_points/specs/repack_snapshots.spec === using 'git am' to apply patch ./v02-0005-Simplify-the-way-restrictions-are-imposed-on-index-f.patch === Applying: Simplify the way restrictions are imposed on index functions. === using 'git am' to apply patch ./v02-0006-Use-separate-transactions-for-catalog-changes.patch === Applying: Use separate transactions for catalog changes. === using 'git am' to apply patch ./v02-0007-Decouple-updating-of-freezing-information-from-swap_.patch === Applying: Decouple updating of freezing information from swap_relation_files(). error: sha1 information is lacking or useless (src/backend/commands/repack.c). error: could not build fake ancestor hint: Use 'git am --show-current-patch=diff' to see the failed patch Patch failed at 0001 Decouple updating of freezing information from swap_relation_files(). 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 ./v02-0007-Decouple-updating-of-freezing-information-from-swap_.patch === patching file src/backend/commands/repack.c Hunk #1 succeeded at 188 with fuzz 1. Hunk #2 succeeded at 1991 (offset -50 lines). Hunk #3 succeeded at 1999 (offset -50 lines). Hunk #4 succeeded at 2031 (offset -50 lines). Hunk #5 succeeded at 2149 (offset -50 lines). Hunk #6 succeeded at 2250 (offset -50 lines). Hunk #7 succeeded at 2352 (offset -50 lines). Hunk #8 succeeded at 2363 (offset -50 lines). Hunk #9 succeeded at 2410 (offset -50 lines). Hunk #10 succeeded at 2427 (offset -50 lines). Hunk #11 succeeded at 2483 (offset -50 lines). Hunk #12 succeeded at 4145 (offset 13 lines). [cf/6957 27eb8c75631] Decouple updating of freezing information from swap_relation_files(). Author: Antonin Houska Date: Wed Jul 15 10:37:12 2026 +0200 1 file changed, 56 insertions(+), 58 deletions(-) === using 'git am' to apply patch ./v02-0008-Make-REPACK-CONCURRENTLY-MVCC-safe.patch === Applying: Make REPACK (CONCURRENTLY) MVCC-safe. error: sha1 information is lacking or useless (src/backend/commands/matview.c). error: could not build fake ancestor hint: Use 'git am --show-current-patch=diff' to see the failed patch Patch failed at 0001 Make REPACK (CONCURRENTLY) MVCC-safe. 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 ./v02-0008-Make-REPACK-CONCURRENTLY-MVCC-safe.patch === patching file doc/src/sgml/mvcc.sgml patching file doc/src/sgml/ref/repack.sgml patching file src/backend/access/common/toast_internals.c patching file src/backend/access/heap/heapam.c Hunk #1 succeeded at 64 with fuzz 1 (offset 1 line). Hunk #2 succeeded at 2005 (offset 1 line). Hunk #3 succeeded at 2019 (offset 2 lines). Hunk #4 succeeded at 2182 with fuzz 2 (offset 16 lines). Hunk #5 succeeded at 2276 (offset 26 lines). Hunk #6 succeeded at 2339 (offset 26 lines). Hunk #7 succeeded at 2773 (offset 42 lines). Hunk #8 succeeded at 2795 with fuzz 1 (offset 43 lines). Hunk #9 succeeded at 2813 (offset 43 lines). Hunk #10 succeeded at 3166 with fuzz 2 (offset 52 lines). Hunk #11 succeeded at 3209 (offset 66 lines). Hunk #12 succeeded at 3242 (offset 66 lines). Hunk #13 succeeded at 3302 (offset 66 lines). Hunk #14 succeeded at 3369 (offset 70 lines). Hunk #15 succeeded at 4001 (offset 91 lines). Hunk #16 FAILED at 4139. Hunk #17 succeeded at 5550 (offset 213 lines). Hunk #18 succeeded at 6551 (offset 240 lines). Hunk #19 succeeded at 6979 (offset 240 lines). Hunk #20 succeeded at 7484 (offset 240 lines). Hunk #21 succeeded at 9063 with fuzz 1 (offset 241 lines). Hunk #22 succeeded at 9288 (offset 259 lines). 1 out of 22 hunks FAILED -- saving rejects to file src/backend/access/heap/heapam.c.rej patching file src/backend/access/heap/heapam_handler.c patching file src/backend/access/heap/heapam_visibility.c patching file src/backend/access/heap/heaptoast.c patching file src/backend/access/heap/rewriteheap.c patching file src/backend/access/table/tableam.c patching file src/backend/access/table/toast_helper.c patching file src/backend/access/transam/xloginsert.c patching file src/backend/access/transam/xlogrecovery.c Hunk #1 succeeded at 1963 (offset 14 lines). patching file src/backend/catalog/indexing.c patching file src/backend/commands/matview.c Hunk #1 succeeded at 895 (offset 1 line). patching file src/backend/commands/repack.c Hunk #6 succeeded at 1039 (offset -50 lines). Hunk #7 succeeded at 1129 (offset -50 lines). Hunk #8 succeeded at 1143 (offset -50 lines). Hunk #9 succeeded at 1174 (offset -50 lines). Hunk #10 succeeded at 1647 (offset -50 lines). Hunk #11 succeeded at 1680 (offset -50 lines). Hunk #12 succeeded at 1706 (offset -50 lines). Hunk #13 succeeded at 1722 (offset -50 lines). Hunk #14 succeeded at 1894 (offset -50 lines). Hunk #15 succeeded at 1906 (offset -50 lines). Hunk #16 succeeded at 2382 (offset -50 lines). Hunk #17 succeeded at 2395 (offset -50 lines). Hunk #18 succeeded at 2403 (offset -50 lines). Hunk #19 succeeded at 2491 (offset -50 lines). Hunk #20 succeeded at 3051 (offset 13 lines). Hunk #21 succeeded at 3087 (offset 13 lines). Hunk #22 succeeded at 3120 (offset 13 lines). Hunk #23 succeeded at 3141 (offset 13 lines). Hunk #24 succeeded at 3158 (offset 13 lines). Hunk #25 succeeded at 3193 (offset 13 lines). Hunk #26 succeeded at 3215 (offset 13 lines). Hunk #27 succeeded at 3230 (offset 13 lines). Hunk #28 succeeded at 3247 (offset 13 lines). Hunk #29 succeeded at 3262 (offset 13 lines). Hunk #30 succeeded at 3360 (offset 13 lines). Hunk #31 succeeded at 3368 (offset 13 lines). Hunk #32 succeeded at 3409 (offset 13 lines). Hunk #33 succeeded at 3433 (offset 13 lines). Hunk #34 succeeded at 3659 (offset 13 lines). Hunk #35 succeeded at 3875 (offset 13 lines). Hunk #36 succeeded at 3909 (offset 13 lines). Hunk #37 succeeded at 4022 (offset 13 lines). Hunk #38 succeeded at 4037 (offset 13 lines). Hunk #39 succeeded at 4049 (offset 13 lines). Hunk #40 succeeded at 4092 (offset 13 lines). Hunk #41 succeeded at 4250 (offset 13 lines). Hunk #42 succeeded at 4266 (offset 13 lines). Hunk #43 succeeded at 4282 (offset 13 lines). Hunk #44 succeeded at 4297 (offset 13 lines). Hunk #45 succeeded at 4308 (offset 13 lines). Hunk #46 succeeded at 4339 (offset 13 lines). Hunk #47 succeeded at 4425 (offset 13 lines). patching file src/backend/commands/tablecmds.c Hunk #1 succeeded at 6131 (offset 9 lines). patching file src/backend/executor/nodeModifyTable.c Hunk #1 succeeded at 1775 (offset 10 lines). patching file src/backend/replication/logical/decode.c patching file src/backend/replication/logical/reorderbuffer.c Hunk #1 succeeded at 5289 (offset 26 lines). patching file src/backend/utils/activity/wait_event_names.txt Hunk #1 succeeded at 185 (offset 1 line). patching file src/include/access/heapam.h patching file src/include/access/heaptoast.h patching file src/include/access/rewriteheap.h patching file src/include/access/tableam.h Hunk #6 succeeded at 1569 (offset 4 lines). Hunk #7 succeeded at 1625 (offset 4 lines). patching file src/include/access/toast_helper.h patching file src/include/access/toast_internals.h patching file src/include/access/xlog_internal.h Hunk #1 FAILED at 32. 1 out of 1 hunk FAILED -- saving rejects to file src/include/access/xlog_internal.h.rej patching file src/include/access/xloginsert.h patching file src/include/access/xlogrecord.h patching file src/include/commands/repack.h patching file src/include/utils/snapmgr.h patching file src/include/utils/snapshot.h patching file src/test/modules/injection_points/expected/repack.out patching file src/test/modules/injection_points/specs/repack.spec Unstaged changes after reset: M doc/src/sgml/mvcc.sgml M doc/src/sgml/ref/repack.sgml M src/backend/access/common/toast_internals.c M src/backend/access/heap/heapam.c M src/backend/access/heap/heapam_handler.c M src/backend/access/heap/heapam_visibility.c M src/backend/access/heap/heaptoast.c M src/backend/access/heap/rewriteheap.c M src/backend/access/table/tableam.c M src/backend/access/table/toast_helper.c M src/backend/access/transam/xloginsert.c M src/backend/access/transam/xlogrecovery.c M src/backend/catalog/indexing.c M src/backend/commands/matview.c M src/backend/commands/repack.c M src/backend/commands/tablecmds.c M src/backend/executor/nodeModifyTable.c M src/backend/replication/logical/decode.c M src/backend/replication/logical/reorderbuffer.c M src/backend/utils/activity/wait_event_names.txt M src/include/access/heapam.h M src/include/access/heaptoast.h M src/include/access/rewriteheap.h M src/include/access/tableam.h M src/include/access/toast_helper.h M src/include/access/toast_internals.h M src/include/access/xloginsert.h M src/include/access/xlogrecord.h M src/include/commands/repack.h M src/include/utils/snapmgr.h M src/include/utils/snapshot.h M src/test/modules/injection_points/expected/repack.out M src/test/modules/injection_points/specs/repack.spec Removing src/backend/access/heap/heapam.c.rej Removing src/include/access/xlog_internal.h.rej === using 'git apply' to apply patch ./v02-0008-Make-REPACK-CONCURRENTLY-MVCC-safe.patch === Applied patch to 'doc/src/sgml/mvcc.sgml' cleanly. Applied patch to 'doc/src/sgml/ref/repack.sgml' cleanly. Applied patch to 'src/backend/access/common/toast_internals.c' cleanly. Applied patch to 'src/backend/access/heap/heapam.c' with conflicts. Applied patch to 'src/backend/access/heap/heapam_handler.c' cleanly. Applied patch to 'src/backend/access/heap/heapam_visibility.c' cleanly. Applied patch to 'src/backend/access/heap/heaptoast.c' cleanly. Applied patch to 'src/backend/access/heap/rewriteheap.c' cleanly. Applied patch to 'src/backend/access/table/tableam.c' cleanly. Applied patch to 'src/backend/access/table/toast_helper.c' cleanly. Applied patch to 'src/backend/access/transam/xloginsert.c' cleanly. Applied patch to 'src/backend/access/transam/xlogrecovery.c' cleanly. Applied patch to 'src/backend/catalog/indexing.c' cleanly. error: repository lacks the necessary blob to perform 3-way merge. Falling back to direct application... error: repository lacks the necessary blob to perform 3-way merge. Falling back to direct application... error: repository lacks the necessary blob to perform 3-way merge. Falling back to direct application... Applied patch to 'src/backend/executor/nodeModifyTable.c' cleanly. Applied patch to 'src/backend/replication/logical/decode.c' cleanly. error: repository lacks the necessary blob to perform 3-way merge. Falling back to direct application... Applied patch to 'src/backend/utils/activity/wait_event_names.txt' cleanly. Applied patch to 'src/include/access/heapam.h' cleanly. Applied patch to 'src/include/access/heaptoast.h' cleanly. Applied patch to 'src/include/access/rewriteheap.h' cleanly. error: repository lacks the necessary blob to perform 3-way merge. Falling back to direct application... Applied patch to 'src/include/access/toast_helper.h' cleanly. Applied patch to 'src/include/access/toast_internals.h' cleanly. Applied patch to 'src/include/access/xlog_internal.h' cleanly. Applied patch to 'src/include/access/xloginsert.h' cleanly. Applied patch to 'src/include/access/xlogrecord.h' cleanly. Applied patch to 'src/include/commands/repack.h' cleanly. Applied patch to 'src/include/utils/snapmgr.h' cleanly. Applied patch to 'src/include/utils/snapshot.h' cleanly. Applied patch to 'src/test/modules/injection_points/expected/repack.out' cleanly. Applied patch to 'src/test/modules/injection_points/specs/repack.spec' cleanly. U src/backend/access/heap/heapam.c diff --cc src/backend/access/heap/heapam.c index d0ffad19a16,35012434d27..00000000000 --- a/src/backend/access/heap/heapam.c +++ b/src/backend/access/heap/heapam.c @@@ -60,11 -60,10 +60,11 @@@ static HeapTuple heap_prepare_insert(Relation relation, HeapTuple tup, TransactionId xid, CommandId cid, uint32 options); static XLogRecPtr log_heap_update(Relation reln, Buffer oldbuf, - Buffer newbuf, HeapTuple oldtup, + Buffer vmbuffer_old, Buffer newbuf, + Buffer vmbuffer_new, HeapTuple oldtup, HeapTuple newtup, HeapTuple old_key_tuple, bool all_visible_cleared, bool new_all_visible_cleared, - bool walLogical); + bool walLogical, TransactionId xid); #ifdef USE_ASSERT_CHECKING static void check_lock_if_inplace_updateable_rel(Relation relation, const ItemPointerData *otid, @@@ -2172,8 -2166,12 +2179,17 @@@ heap_insert(Relation relation, HeapTupl /* filtering by origin on a row level is much more efficient */ XLogSetRecordFlags(XLOG_INCLUDE_ORIGIN); ++<<<<<<< ours + if (vmbuffer_modified) + XLogRegisterBuffer(HEAP_INSERT_BLKREF_VM, vmbuffer, 0); ++======= + /* + * Even if we don't have XID assigned, valid XID is necessary for + * recovery and streaming replication to work. + */ + if (options & TABLE_REUSE_XID) + XLogSetRecordXid(xid); ++>>>>>>> theirs recptr = XLogInsert(RM_HEAP_ID, info); @@@ -2776,9 -2749,10 +2794,10 @@@ heap_delete(Relation relation, const It bool walLogical = (options & TABLE_DELETE_NO_LOGICAL) == 0; bool have_tuple_lock = false; bool iscombo; - bool all_visible_cleared = false; + bool clear_all_visible = false; HeapTuple old_key_tuple = NULL; /* replica identity of the tuple */ bool old_key_copied = false; + bool override_xid = false; Assert(ItemPointerIsValid(tid)); @@@ -3141,10 -3114,10 +3168,13 @@@ l1 /* filtering by origin on a row level is much more efficient */ XLogSetRecordFlags(XLOG_INCLUDE_ORIGIN); + /* See heap_insert() for details. */ + if (override_xid) + XLogSetRecordXid(xid); + if (vmbuffer_modified) + XLogRegisterBuffer(HEAP_DELETE_BLKREF_VM, vmbuffer, 0); + recptr = XLogInsert(RM_HEAP_ID, XLOG_HEAP_DELETE); PageSetLSN(page, recptr); @@@ -4271,14 -4135,13 +4313,22 @@@ l2 } recptr = log_heap_update(relation, buffer, - newbuf, &oldtup, heaptup, + vmbuffer_modified ? vmbuffer : InvalidBuffer, + newbuf, + vmbuffer_new_modified ? vmbuffer_new : InvalidBuffer, + &oldtup, heaptup, old_key_tuple, ++<<<<<<< ours + clear_all_visible, + clear_all_visible_new, + walLogical); ++======= + all_visible_cleared, + all_visible_cleared_new, + walLogical, + options & TABLE_REUSE_XID ? xid : InvalidTransactionId); + ++>>>>>>> theirs if (newbuf != buffer) { PageSetLSN(newpage, recptr); @@@ -9012,12 -8820,11 +9068,12 @@@ bottomup_sort_and_shrink(TM_IndexDelete * have modified the buffer(s) and marked them dirty. */ static XLogRecPtr -log_heap_update(Relation reln, Buffer oldbuf, - Buffer newbuf, HeapTuple oldtup, HeapTuple newtup, +log_heap_update(Relation reln, Buffer oldbuf, Buffer vmbuffer_old, + Buffer newbuf, Buffer vmbuffer_new, + HeapTuple oldtup, HeapTuple newtup, HeapTuple old_key_tuple, bool all_visible_cleared, bool new_all_visible_cleared, - bool walLogical) + bool walLogical, TransactionId xid) { xl_heap_update xlrec; xl_heap_header xlhdr;