=== Applying patches on top of PostgreSQL commit ID a32b8dc9865aa5189d20eca273700b10dfd92fc7 === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Tue Oct 6 23:40:31 UTC 2026 On branch cf/6824 nothing to commit, working tree clean === using 'git am' to apply patch ./0001-Write-stashed-update-chain-tuples-with-their-own-TOA.patch === Applying: Write stashed update-chain tuples with their own TOAST flags error: sha1 information is lacking or useless (contrib/dblink/expected/rewrite_stale_xmin.out). error: could not build fake ancestor hint: Use 'git am --show-current-patch=diff' to see the failed patch Patch failed at 0001 Write stashed update-chain tuples with their own TOAST flags 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-Write-stashed-update-chain-tuples-with-their-own-TOA.patch === can't find file to patch at input line 37 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |From 687708781e8f43a09a2a6bcd55b6d8cbb3b10d53 Mon Sep 17 00:00:00 2001 |From: Rui Zhao |Date: Thu, 20 Aug 2026 00:10:23 +0800 |Subject: [PATCH] Write stashed update-chain tuples with their own TOAST flags | |rewrite_heap_tuple() stashes the prior version of an update pair in |rs_unresolved_tups and writes it out when the successor arrives, but |the write reused the successor's flags: a live successor resolves a |recently-dead prior version with flags = 0, and detoasting the prior |version's already-reclaimed chunks fails with "missing chunk". The |same applied to the leftovers end_heap_rewrite() writes, which passed |a hardcoded 0. | |Keep the flags a tuple was scanned with in its UnresolvedTupData and |use them at both write-out sites. A failed insert of a stashed tuple |cannot be reported through rewrite_heap_tuple()'s return value -- the |caller's tuple has already been written, and the caller would adjust |the counters for the wrong tuple -- so drop the tuple on the spot and |have end_heap_rewrite() return the number of such drops, which the |caller folds into tups_vacuumed / num_tuples / tups_recently_dead. | |Add UPDATE permutations for VACUUM FULL and REPACK to the |rewrite_stale_xmin isolation spec; they fail with "missing chunk" |without this fix. |--- | .../dblink/expected/rewrite_stale_xmin.out | 118 ++++++++++++++++++ | contrib/dblink/specs/rewrite_stale_xmin.spec | 27 ++++ | src/backend/access/heap/heapam_handler.c | 15 ++- | src/backend/access/heap/rewriteheap.c | 44 ++++++- | src/include/access/rewriteheap.h | 2 +- | 5 files changed, 199 insertions(+), 7 deletions(-) | |diff --git a/contrib/dblink/expected/rewrite_stale_xmin.out b/contrib/dblink/expected/rewrite_stale_xmin.out |index 2e5a7940ea2..ff600edd68d 100644 |--- a/contrib/dblink/expected/rewrite_stale_xmin.out |+++ b/contrib/dblink/expected/rewrite_stale_xmin.out -------------------------- No file to patch. Skipping patch. 1 out of 1 hunk ignored can't find file to patch at input line 163 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |diff --git a/contrib/dblink/specs/rewrite_stale_xmin.spec b/contrib/dblink/specs/rewrite_stale_xmin.spec |index fe88e789f85..b670c6b4435 100644 |--- a/contrib/dblink/specs/rewrite_stale_xmin.spec |+++ b/contrib/dblink/specs/rewrite_stale_xmin.spec -------------------------- No file to patch. Skipping patch. 2 out of 2 hunks ignored patching file src/backend/access/heap/heapam_handler.c Hunk #1 succeeded at 939 (offset -70 lines). patching file src/backend/access/heap/rewriteheap.c Hunk #3 FAILED at 297. Hunk #4 succeeded at 326 (offset -1 lines). Hunk #5 succeeded at 438 (offset -2 lines). Hunk #6 FAILED at 467. Hunk #7 succeeded at 502 (offset -8 lines). 2 out of 7 hunks FAILED -- saving rejects to file src/backend/access/heap/rewriteheap.c.rej patching file src/include/access/rewriteheap.h Hunk #1 FAILED at 24. 1 out of 1 hunk FAILED -- saving rejects to file src/include/access/rewriteheap.h.rej Unstaged changes after reset: M src/backend/access/heap/heapam_handler.c M src/backend/access/heap/rewriteheap.c Removing src/backend/access/heap/rewriteheap.c.rej Removing src/include/access/rewriteheap.h.rej === using 'git apply' to apply patch ./0001-Write-stashed-update-chain-tuples-with-their-own-TOA.patch === error: contrib/dblink/expected/rewrite_stale_xmin.out: does not exist in index error: contrib/dblink/specs/rewrite_stale_xmin.spec: does not exist in index 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: patch failed: src/backend/access/heap/rewriteheap.c:294 error: src/backend/access/heap/rewriteheap.c: patch does not apply error: repository lacks the necessary blob to perform 3-way merge. Falling back to direct application... error: patch failed: src/include/access/rewriteheap.h:24 error: src/include/access/rewriteheap.h: patch does not apply