=== Applying patches on top of PostgreSQL commit ID ed26c4e25a444fcdd8a9120d4fe4b5a08d2b262b === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Wed Jul 9 08:22:21 UTC 2025 On branch cf/5839 nothing to commit, working tree clean === using 'git am' to apply patch ./v1-0001-autovac-save-all-relopts-instead-of-just-avopts.patch === Applying: autovac: save all relopts instead of just avopts === using 'git am' to apply patch ./v1-0002-autovac-resolve-relopts-before-vacuuming.patch === Applying: autovac: resolve relopts before vacuuming error: sha1 information is lacking or useless (src/backend/postmaster/autovacuum.c). error: could not build fake ancestor hint: Use 'git am --show-current-patch=diff' to see the failed patch Patch failed at 0001 autovac: resolve relopts before vacuuming 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 ./v1-0002-autovac-resolve-relopts-before-vacuuming.patch === patching file src/backend/commands/vacuum.c Hunk #1 succeeded at 422 (offset 1 line). Hunk #2 FAILED at 2195. 1 out of 2 hunks FAILED -- saving rejects to file src/backend/commands/vacuum.c.rej patching file src/backend/postmaster/autovacuum.c Unstaged changes after reset: M src/backend/commands/vacuum.c M src/backend/postmaster/autovacuum.c Removing src/backend/commands/vacuum.c.rej === using 'git apply' to apply patch ./v1-0002-autovac-resolve-relopts-before-vacuuming.patch === Applied patch to 'src/backend/commands/vacuum.c' cleanly. error: repository lacks the necessary blob to perform 3-way merge. Falling back to direct application... [cf/5839 cf27d230bb7] autovac: resolve relopts before vacuuming Author: Nathan Bossart Date: Mon Jun 23 14:42:39 2025 -0500 2 files changed, 44 insertions(+), 15 deletions(-) === using 'git am' to apply patch ./v1-0003-autovac-combine-reloptions-correctly.patch === fatal: previous rebase directory .git/rebase-apply still exists but mbox given. === using patch(1) to apply patch ./v1-0003-autovac-combine-reloptions-correctly.patch === patching file src/backend/postmaster/autovacuum.c [cf/5839 5e58db81084] autovac: combine reloptions correctly Author: Nathan Bossart Date: Mon Jun 23 15:16:38 2025 -0500 1 file changed, 85 insertions(+) === using 'git am' to apply patch ./v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch === fatal: previous rebase directory .git/rebase-apply still exists but mbox given. === using patch(1) to apply patch ./v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch === patching file src/backend/commands/vacuum.c Hunk #1 FAILED at 124. Hunk #2 succeeded at 633 with fuzz 2 (offset -1 lines). Hunk #3 FAILED at 1998. Hunk #4 FAILED at 2008. Hunk #5 succeeded at 2169 (offset 4 lines). Hunk #6 succeeded at 2189 with fuzz 1 (offset 4 lines). Hunk #7 FAILED at 2205. Hunk #8 FAILED at 2219. Hunk #9 FAILED at 2322. 6 out of 9 hunks FAILED -- saving rejects to file src/backend/commands/vacuum.c.rej patching file src/backend/postmaster/autovacuum.c patching file src/include/commands/vacuum.h Unstaged changes after reset: M src/backend/commands/vacuum.c M src/backend/postmaster/autovacuum.c M src/include/commands/vacuum.h Removing src/backend/commands/vacuum.c.rej === using 'git apply' to apply patch ./v1-0004-combine-relopts-correctly-for-VACUUM-commands.patch === Applied patch to 'src/backend/commands/vacuum.c' with conflicts. error: repository lacks the necessary blob to perform 3-way merge. Falling back to direct application... Applied patch to 'src/include/commands/vacuum.h' cleanly. U src/backend/commands/vacuum.c diff --cc src/backend/commands/vacuum.c index c61fd7d7381,a74c3a9e2a2..00000000000 --- a/src/backend/commands/vacuum.c +++ b/src/backend/commands/vacuum.c @@@ -124,8 -123,8 +124,13 @@@ static void vac_truncate_clog(Transacti MultiXactId minMulti, TransactionId lastSaneFrozenXid, MultiXactId lastSaneMinMulti); ++<<<<<<< ours +static bool vacuum_rel(Oid relid, RangeVar *relation, VacuumParams params, + BufferAccessStrategy bstrategy); ++======= + static bool vacuum_rel(Oid relid, RangeVar *relation, VacuumParams *params, + BufferAccessStrategy bstrategy, StdRdOptions *main_opts); ++>>>>>>> theirs static double compute_parallel_delay(void); static VacOptValue get_vacoptval_from_boolean(DefElem *def); static bool vac_tid_reaped(ItemPointer itemptr, void *state); @@@ -631,9 -632,9 +636,9 @@@ vacuum(List *relations, const VacuumPar { VacuumRelation *vrel = lfirst_node(VacuumRelation, cur); - if (params->options & VACOPT_VACUUM) + if (params.options & VACOPT_VACUUM) { - if (!vacuum_rel(vrel->oid, vrel->relation, params, bstrategy)) + if (!vacuum_rel(vrel->oid, vrel->relation, params, bstrategy, NULL)) continue; } @@@ -1996,8 -1997,8 +2001,13 @@@ vac_truncate_clog(TransactionId frozenX * At entry and exit, we are not inside a transaction. */ static bool ++<<<<<<< ours +vacuum_rel(Oid relid, RangeVar *relation, VacuumParams params, + BufferAccessStrategy bstrategy) ++======= + vacuum_rel(Oid relid, RangeVar *relation, VacuumParams *params, + BufferAccessStrategy bstrategy, StdRdOptions *main_opts) ++>>>>>>> theirs { LOCKMODE lmode; Relation rel; @@@ -2007,13 -2008,10 +2017,18 @@@ Oid save_userid; int save_sec_context; int save_nestlevel; ++<<<<<<< ours + VacuumParams toast_vacuum_params; ++======= + StdRdOptions saved_opts; + StdRdOptions combined_opts; ++>>>>>>> theirs - Assert(params != NULL); + /* + * This function scribbles on the parameters, so make a copy early to + * avoid affecting the TOAST table (if we do end up recursing to it). + */ + memcpy(&toast_vacuum_params, ¶ms, sizeof(VacuumParams)); /* Begin a transaction for vacuuming this relation */ StartTransactionCommand(); @@@ -2180,13 -2187,12 +2204,12 @@@ if (rel->rd_options == NULL) vacuum_index_cleanup = STDRD_OPTION_VACUUM_INDEX_CLEANUP_AUTO; else - vacuum_index_cleanup = - ((StdRdOptions *) rel->rd_options)->vacuum_index_cleanup; + vacuum_index_cleanup = combined_opts.vacuum_index_cleanup; if (vacuum_index_cleanup == STDRD_OPTION_VACUUM_INDEX_CLEANUP_AUTO) - params->index_cleanup = VACOPTVALUE_AUTO; + params.index_cleanup = VACOPTVALUE_AUTO; else if (vacuum_index_cleanup == STDRD_OPTION_VACUUM_INDEX_CLEANUP_ON) - params->index_cleanup = VACOPTVALUE_ENABLED; + params.index_cleanup = VACOPTVALUE_ENABLED; else { Assert(vacuum_index_cleanup == @@@ -2210,9 -2207,9 +2233,15 @@@ */ if (params->max_eager_freeze_failure_rate < 0 && rel->rd_options != NULL && ++<<<<<<< ours + ((StdRdOptions *) rel->rd_options)->vacuum_max_eager_freeze_failure_rate >= 0) + params.max_eager_freeze_failure_rate = + ((StdRdOptions *) rel->rd_options)->vacuum_max_eager_freeze_failure_rate; ++======= + combined_opts.vacuum_max_eager_freeze_failure_rate >= 0) + params->max_eager_freeze_failure_rate = + combined_opts.vacuum_max_eager_freeze_failure_rate; ++>>>>>>> theirs else params->max_eager_freeze_failure_rate = vacuum_max_eager_freeze_failure_rate; @@@ -2224,28 -2221,19 +2253,33 @@@ { StdRdOptions *opts = (StdRdOptions *) rel->rd_options; - if (opts && opts->vacuum_truncate_set) + if (opts && combined_opts.vacuum_truncate_set) { ++<<<<<<< ours + if (opts->vacuum_truncate) + params.truncate = VACOPTVALUE_ENABLED; ++======= + if (combined_opts.vacuum_truncate) + params->truncate = VACOPTVALUE_ENABLED; ++>>>>>>> theirs else - params->truncate = VACOPTVALUE_DISABLED; + params.truncate = VACOPTVALUE_DISABLED; } else if (vacuum_truncate) - params->truncate = VACOPTVALUE_ENABLED; + params.truncate = VACOPTVALUE_ENABLED; else - params->truncate = VACOPTVALUE_DISABLED; + params.truncate = VACOPTVALUE_DISABLED; } +#ifdef USE_INJECTION_POINTS + if (params.truncate == VACOPTVALUE_AUTO) + INJECTION_POINT("vacuum-truncate-auto", NULL); + else if (params.truncate == VACOPTVALUE_DISABLED) + INJECTION_POINT("vacuum-truncate-disabled", NULL); + else if (params.truncate == VACOPTVALUE_ENABLED) + INJECTION_POINT("vacuum-truncate-enabled", NULL); +#endif + /* * Remember the relation's TOAST relation for later, if the caller asked * us to process it. In VACUUM FULL, though, the toast table is @@@ -2333,7 -2323,8 +2367,11 @@@ toast_vacuum_params.options |= VACOPT_PROCESS_MAIN; toast_vacuum_params.toast_parent = relid; ++<<<<<<< ours + vacuum_rel(toast_relid, NULL, toast_vacuum_params, bstrategy); ++======= + vacuum_rel(toast_relid, NULL, &toast_vacuum_params, bstrategy, &saved_opts); ++>>>>>>> theirs } /*