=== 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. Thu Aug 13 04:14:24 UTC 2026 On branch cf/6883 nothing to commit, working tree clean === using 'git am' to apply patch ./v2-0001-Make-log_lock_failures-support-LOCK-NOWAIT.patch === Applying: Make log_lock_failures support LOCK NOWAIT Using index info to reconstruct a base tree... M doc/src/sgml/config.sgml M src/backend/catalog/namespace.c M src/backend/commands/lockcmds.c M src/backend/commands/repack.c M src/backend/commands/tablecmds.c M src/backend/commands/vacuum.c M src/backend/postmaster/autovacuum.c Falling back to patching base and 3-way merge... Auto-merging src/backend/postmaster/autovacuum.c Auto-merging src/backend/commands/vacuum.c Auto-merging src/backend/commands/tablecmds.c Auto-merging src/backend/commands/repack.c CONFLICT (content): Merge conflict in src/backend/commands/repack.c Auto-merging src/backend/commands/lockcmds.c Auto-merging src/backend/catalog/namespace.c Auto-merging doc/src/sgml/config.sgml error: Failed to merge in the changes. hint: Use 'git am --show-current-patch=diff' to see the failed patch Patch failed at 0001 Make log_lock_failures support LOCK NOWAIT 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 ./v2-0001-Make-log_lock_failures-support-LOCK-NOWAIT.patch === patching file doc/src/sgml/config.sgml Hunk #1 succeeded at 8467 (offset 94 lines). patching file src/backend/catalog/namespace.c patching file src/backend/commands/lockcmds.c Hunk #2 succeeded at 144 (offset 12 lines). Hunk #3 succeeded at 241 (offset 22 lines). patching file src/backend/commands/repack.c Hunk #1 FAILED at 2165. Hunk #2 FAILED at 2224. 2 out of 2 hunks FAILED -- saving rejects to file src/backend/commands/repack.c.rej patching file src/backend/commands/tablecmds.c Hunk #1 succeeded at 17843 (offset 486 lines). patching file src/backend/commands/vacuum.c Hunk #1 succeeded at 807 (offset 18 lines). patching file src/backend/postmaster/autovacuum.c Hunk #1 succeeded at 2222 (offset 2 lines). patching file src/backend/storage/lmgr/lmgr.c patching file src/include/storage/lmgr.h Unstaged changes after reset: M doc/src/sgml/config.sgml M src/backend/catalog/namespace.c M src/backend/commands/lockcmds.c M src/backend/commands/tablecmds.c M src/backend/commands/vacuum.c M src/backend/postmaster/autovacuum.c M src/backend/storage/lmgr/lmgr.c M src/include/storage/lmgr.h Removing src/backend/commands/repack.c.rej === using 'git apply' to apply patch ./v2-0001-Make-log_lock_failures-support-LOCK-NOWAIT.patch === Applied patch to 'doc/src/sgml/config.sgml' cleanly. Applied patch to 'src/backend/catalog/namespace.c' cleanly. Applied patch to 'src/backend/commands/lockcmds.c' cleanly. Applied patch to 'src/backend/commands/repack.c' with conflicts. Applied patch to 'src/backend/commands/tablecmds.c' cleanly. Applied patch to 'src/backend/commands/vacuum.c' cleanly. Applied patch to 'src/backend/postmaster/autovacuum.c' cleanly. Applied patch to 'src/backend/storage/lmgr/lmgr.c' cleanly. Applied patch to 'src/include/storage/lmgr.h' cleanly. U src/backend/commands/repack.c diff --cc src/backend/commands/repack.c index dde56fb1e8d,923c768b0c7..00000000000 --- a/src/backend/commands/repack.c +++ b/src/backend/commands/repack.c @@@ -2134,17 -2159,34 +2134,30 @@@ get_tables_to_repack(RepackCommand cmd index = (Form_pg_index) GETSTRUCT(tuple); ++<<<<<<< ours ++======= + /* + * Try to obtain a light lock on the index's table, to ensure it + * doesn't go away while we collect the list. If we cannot, just + * disregard it. Be sure to release this if we ultimately decide + * not to process the table! + */ + if (!ConditionalLockRelationOid(index->indrelid, AccessShareLock, false)) + continue; + + /* Verify that the table still exists; skip if not */ ++>>>>>>> theirs classtup = SearchSysCache1(RELOID, ObjectIdGetDatum(index->indrelid)); if (!HeapTupleIsValid(classtup)) - { - UnlockRelationOid(index->indrelid, AccessShareLock); continue; - } - classForm = (Form_pg_class) GETSTRUCT(classtup); + relnamespace = ((Form_pg_class) GETSTRUCT(classtup))->relnamespace; + relpersistence = ((Form_pg_class) GETSTRUCT(classtup))->relpersistence; + ReleaseSysCache(classtup); /* Skip temp relations belonging to other sessions */ - if (classForm->relpersistence == RELPERSISTENCE_TEMP && - !isTempOrTempToastNamespace(classForm->relnamespace)) - { - ReleaseSysCache(classtup); - UnlockRelationOid(index->indrelid, AccessShareLock); + if (relpersistence == RELPERSISTENCE_TEMP && + !isTempOrTempToastNamespace(relnamespace)) continue; - } - - ReleaseSysCache(classtup); /* noisily skip rels which the user can't process */ if (!repack_is_permitted_for_relation(cmd, index->indrelid, @@@ -2173,6 -2218,22 +2186,25 @@@ class = (Form_pg_class) GETSTRUCT(tuple); ++<<<<<<< ours ++======= + /* + * Try to obtain a light lock on the table, to ensure it doesn't + * go away while we collect the list. If we cannot, just + * disregard the table. Be sure to release this if we ultimately + * decide not to process the table! + */ + if (!ConditionalLockRelationOid(class->oid, AccessShareLock, false)) + continue; + + /* Verify that the table still exists */ + if (!SearchSysCacheExists1(RELOID, ObjectIdGetDatum(class->oid))) + { + UnlockRelationOid(class->oid, AccessShareLock); + continue; + } + ++>>>>>>> theirs /* Can only process plain tables and matviews */ if (class->relkind != RELKIND_RELATION && class->relkind != RELKIND_MATVIEW)