=== Applying patches on top of PostgreSQL commit ID 0e944fe3579ecd525e5ffe7b7db4a7e1c34de49e === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Mon Aug 31 07:13:29 UTC 2026 On branch cf/7230 nothing to commit, working tree clean === using 'git am' to apply patch ./v1-0001-Support-selective-logical-WAL-for-restricted-repl.patch === Applying: Support selective logical WAL for restricted replication slots Using index info to reconstruct a base tree... M doc/src/sgml/catalogs.sgml M doc/src/sgml/config.sgml M src/backend/access/transam/xlog.c M src/backend/catalog/pg_subscription.c M src/backend/commands/subscriptioncmds.c M src/backend/commands/tablecmds.c M src/backend/postmaster/autovacuum.c M src/backend/replication/logical/reorderbuffer.c M src/backend/replication/walreceiver.c M src/bin/pg_dump/pg_dump.c M src/include/access/xlog.h M src/include/catalog/pg_proc.dat M src/test/recovery/meson.build M src/tools/pgindent/typedefs.list Falling back to patching base and 3-way merge... Auto-merging src/tools/pgindent/typedefs.list Auto-merging src/test/recovery/meson.build CONFLICT (content): Merge conflict in src/test/recovery/meson.build Auto-merging src/include/catalog/pg_proc.dat Auto-merging src/include/access/xlog.h Auto-merging src/bin/pg_dump/pg_dump.c Auto-merging src/backend/replication/walreceiver.c CONFLICT (content): Merge conflict in src/backend/replication/walreceiver.c Auto-merging src/backend/replication/logical/reorderbuffer.c CONFLICT (content): Merge conflict in src/backend/replication/logical/reorderbuffer.c Auto-merging src/backend/postmaster/autovacuum.c Auto-merging src/backend/commands/tablecmds.c Auto-merging src/backend/commands/subscriptioncmds.c Auto-merging src/backend/catalog/pg_subscription.c Auto-merging src/backend/access/transam/xlog.c Auto-merging doc/src/sgml/config.sgml Auto-merging doc/src/sgml/catalogs.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 Support selective logical WAL for restricted replication slots 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-0001-Support-selective-logical-WAL-for-restricted-repl.patch === patching file doc/src/sgml/catalogs.sgml Hunk #2 succeeded at 2148 (offset 12 lines). Hunk #3 succeeded at 7164 (offset 12 lines). Hunk #4 succeeded at 8760 (offset 12 lines). patching file doc/src/sgml/config.sgml patching file doc/src/sgml/func/func-admin.sgml patching file doc/src/sgml/protocol.sgml patching file doc/src/sgml/ref/alter_subscription.sgml patching file doc/src/sgml/ref/create_subscription.sgml patching file doc/src/sgml/system-views.sgml patching file src/backend/access/heap/heapam.c patching file src/backend/access/transam/xlog.c Hunk #1 succeeded at 5278 (offset 28 lines). patching file src/backend/catalog/heap.c patching file src/backend/catalog/pg_subscription.c patching file src/backend/catalog/system_views.sql patching file src/backend/catalog/toasting.c patching file src/backend/commands/publicationcmds.c patching file src/backend/commands/subscriptioncmds.c Hunk #1 succeeded at 84 (offset 1 line). Hunk #2 succeeded at 110 (offset 1 line). Hunk #3 succeeded at 202 (offset 1 line). Hunk #4 succeeded at 355 (offset 1 line). Hunk #5 succeeded at 553 (offset 1 line). Hunk #6 succeeded at 706 (offset 1 line). Hunk #7 succeeded at 880 (offset 1 line). Hunk #8 succeeded at 1082 (offset 1 line). Hunk #9 succeeded at 1759 (offset 4 lines). patching file src/backend/commands/tablecmds.c Hunk #1 succeeded at 48 (offset -1 lines). Hunk #2 succeeded at 91 (offset -2 lines). Hunk #3 succeeded at 3629 (offset -31 lines). Hunk #4 succeeded at 19750 (offset -60 lines). patching file src/backend/postmaster/autovacuum.c Hunk #2 succeeded at 2683 (offset 15 lines). patching file src/backend/replication/libpqwalreceiver/libpqwalreceiver.c patching file src/backend/replication/logical/Makefile patching file src/backend/replication/logical/logicalctl.c patching file src/backend/replication/logical/meson.build patching file src/backend/replication/logical/reorderbuffer.c Hunk #2 succeeded at 2364 (offset 10 lines). Hunk #3 FAILED at 2492. 1 out of 3 hunks FAILED -- saving rejects to file src/backend/replication/logical/reorderbuffer.c.rej patching file src/backend/replication/logical/slotscope.c patching file src/backend/replication/logical/slotsync.c patching file src/backend/replication/logical/tablesync.c patching file src/backend/replication/pgoutput/pgoutput.c patching file src/backend/replication/slot.c patching file src/backend/replication/slotfuncs.c patching file src/backend/replication/walreceiver.c Hunk #1 FAILED at 441. 1 out of 1 hunk FAILED -- saving rejects to file src/backend/replication/walreceiver.c.rej patching file src/backend/replication/walsender.c patching file src/backend/utils/init/postinit.c patching file src/backend/utils/misc/guc_parameters.dat patching file src/backend/utils/misc/guc_tables.c patching file src/bin/pg_dump/pg_dump.c patching file src/bin/pg_dump/pg_dump.h patching file src/bin/pg_dump/t/002_pg_dump.pl patching file src/include/access/xlog.h patching file src/include/catalog/Makefile patching file src/include/catalog/meson.build patching file src/include/catalog/pg_class.h patching file src/include/catalog/pg_proc.dat patching file src/include/catalog/pg_restricted_slot_relation.h patching file src/include/catalog/pg_subscription.h patching file src/include/replication/logicalctl.h patching file src/include/replication/slot.h patching file src/include/replication/slotscope.h patching file src/include/replication/walreceiver.h patching file src/include/utils/guc_hooks.h patching file src/include/utils/rel.h patching file src/test/recovery/meson.build Hunk #1 FAILED at 64. 1 out of 1 hunk FAILED -- saving rejects to file src/test/recovery/meson.build.rej patching file src/test/recovery/t/040_standby_failover_slots_sync.pl patching file src/test/recovery/t/056_logical_slot_scope.pl patching file src/test/regress/expected/oidjoins.out patching file src/test/regress/expected/rules.out patching file src/tools/pgindent/typedefs.list Hunk #1 succeeded at 1697 (offset -1 lines). Unstaged changes after reset: M doc/src/sgml/catalogs.sgml M doc/src/sgml/config.sgml M doc/src/sgml/func/func-admin.sgml M doc/src/sgml/protocol.sgml M doc/src/sgml/ref/alter_subscription.sgml M doc/src/sgml/ref/create_subscription.sgml M doc/src/sgml/system-views.sgml M src/backend/access/heap/heapam.c M src/backend/access/transam/xlog.c M src/backend/catalog/heap.c M src/backend/catalog/pg_subscription.c M src/backend/catalog/system_views.sql M src/backend/catalog/toasting.c M src/backend/commands/publicationcmds.c M src/backend/commands/subscriptioncmds.c M src/backend/commands/tablecmds.c M src/backend/postmaster/autovacuum.c M src/backend/replication/libpqwalreceiver/libpqwalreceiver.c M src/backend/replication/logical/Makefile M src/backend/replication/logical/logicalctl.c M src/backend/replication/logical/meson.build M src/backend/replication/logical/reorderbuffer.c M src/backend/replication/logical/slotsync.c M src/backend/replication/logical/tablesync.c M src/backend/replication/pgoutput/pgoutput.c M src/backend/replication/slot.c M src/backend/replication/slotfuncs.c M src/backend/replication/walsender.c M src/backend/utils/init/postinit.c M src/backend/utils/misc/guc_parameters.dat M src/backend/utils/misc/guc_tables.c M src/bin/pg_dump/pg_dump.c M src/bin/pg_dump/pg_dump.h M src/bin/pg_dump/t/002_pg_dump.pl M src/include/access/xlog.h M src/include/catalog/Makefile M src/include/catalog/meson.build M src/include/catalog/pg_class.h M src/include/catalog/pg_proc.dat M src/include/catalog/pg_subscription.h M src/include/replication/logicalctl.h M src/include/replication/slot.h M src/include/replication/walreceiver.h M src/include/utils/guc_hooks.h M src/include/utils/rel.h M src/test/recovery/t/040_standby_failover_slots_sync.pl M src/test/regress/expected/oidjoins.out M src/test/regress/expected/rules.out M src/tools/pgindent/typedefs.list Removing src/backend/replication/logical/reorderbuffer.c.rej Removing src/backend/replication/logical/slotscope.c Removing src/backend/replication/walreceiver.c.rej Removing src/include/catalog/pg_restricted_slot_relation.h Removing src/include/replication/slotscope.h Removing src/test/recovery/meson.build.rej Removing src/test/recovery/t/056_logical_slot_scope.pl === using 'git apply' to apply patch ./v1-0001-Support-selective-logical-WAL-for-restricted-repl.patch === Applied patch to 'doc/src/sgml/catalogs.sgml' cleanly. Applied patch to 'doc/src/sgml/config.sgml' cleanly. Applied patch to 'doc/src/sgml/func/func-admin.sgml' cleanly. Applied patch to 'doc/src/sgml/protocol.sgml' cleanly. Applied patch to 'doc/src/sgml/ref/alter_subscription.sgml' cleanly. Applied patch to 'doc/src/sgml/ref/create_subscription.sgml' cleanly. Applied patch to 'doc/src/sgml/system-views.sgml' cleanly. Applied patch to 'src/backend/access/heap/heapam.c' cleanly. Applied patch to 'src/backend/access/transam/xlog.c' cleanly. Applied patch to 'src/backend/catalog/heap.c' cleanly. Applied patch to 'src/backend/catalog/pg_subscription.c' cleanly. Applied patch to 'src/backend/catalog/system_views.sql' cleanly. Applied patch to 'src/backend/catalog/toasting.c' cleanly. Applied patch to 'src/backend/commands/publicationcmds.c' cleanly. Applied patch to 'src/backend/commands/subscriptioncmds.c' cleanly. Applied patch to 'src/backend/commands/tablecmds.c' cleanly. Applied patch to 'src/backend/postmaster/autovacuum.c' cleanly. Applied patch to 'src/backend/replication/libpqwalreceiver/libpqwalreceiver.c' cleanly. Applied patch to 'src/backend/replication/logical/Makefile' cleanly. Applied patch to 'src/backend/replication/logical/logicalctl.c' cleanly. Applied patch to 'src/backend/replication/logical/meson.build' cleanly. Applied patch to 'src/backend/replication/logical/reorderbuffer.c' with conflicts. Falling back to direct application... Applied patch to 'src/backend/replication/logical/slotsync.c' cleanly. Applied patch to 'src/backend/replication/logical/tablesync.c' cleanly. Applied patch to 'src/backend/replication/pgoutput/pgoutput.c' cleanly. Applied patch to 'src/backend/replication/slot.c' cleanly. Applied patch to 'src/backend/replication/slotfuncs.c' cleanly. Applied patch to 'src/backend/replication/walreceiver.c' with conflicts. Applied patch to 'src/backend/replication/walsender.c' cleanly. Applied patch to 'src/backend/utils/init/postinit.c' cleanly. Applied patch to 'src/backend/utils/misc/guc_parameters.dat' cleanly. Applied patch to 'src/backend/utils/misc/guc_tables.c' cleanly. Applied patch to 'src/bin/pg_dump/pg_dump.c' cleanly. Applied patch to 'src/bin/pg_dump/pg_dump.h' cleanly. Applied patch to 'src/bin/pg_dump/t/002_pg_dump.pl' cleanly. Applied patch to 'src/include/access/xlog.h' cleanly. Applied patch to 'src/include/catalog/Makefile' cleanly. Applied patch to 'src/include/catalog/meson.build' cleanly. Applied patch to 'src/include/catalog/pg_class.h' cleanly. Applied patch to 'src/include/catalog/pg_proc.dat' cleanly. Falling back to direct application... Applied patch to 'src/include/catalog/pg_subscription.h' cleanly. Applied patch to 'src/include/replication/logicalctl.h' cleanly. Applied patch to 'src/include/replication/slot.h' cleanly. Falling back to direct application... Applied patch to 'src/include/replication/walreceiver.h' cleanly. Applied patch to 'src/include/utils/guc_hooks.h' cleanly. Applied patch to 'src/include/utils/rel.h' cleanly. Applied patch to 'src/test/recovery/meson.build' with conflicts. Applied patch to 'src/test/recovery/t/040_standby_failover_slots_sync.pl' cleanly. Falling back to direct application... Applied patch to 'src/test/regress/expected/oidjoins.out' cleanly. Applied patch to 'src/test/regress/expected/rules.out' cleanly. Applied patch to 'src/tools/pgindent/typedefs.list' cleanly. U src/backend/replication/logical/reorderbuffer.c U src/backend/replication/walreceiver.c U src/test/recovery/meson.build diff --cc src/backend/replication/logical/reorderbuffer.c index 900864afc6d,cfbcd119900..00000000000 --- a/src/backend/replication/logical/reorderbuffer.c +++ b/src/backend/replication/logical/reorderbuffer.c @@@ -2501,11 -2492,8 +2502,15 @@@ ReorderBufferProcessTXN(ReorderBuffer * if (!RelationIsValid(rel)) elog(ERROR, "could not open relation with OID %u", relid); ++<<<<<<< ours + if (!RelationIsLogicallyLogged(rel)) + { + RelationClose(rel); ++======= + if (!RelationCanBeLogicallyLogged(rel)) ++>>>>>>> theirs continue; + } relations[nrelations++] = rel; } diff --cc src/backend/replication/walreceiver.c index b93e699ba4b,07120cf0ee2..00000000000 --- a/src/backend/replication/walreceiver.c +++ b/src/backend/replication/walreceiver.c @@@ -441,16 -437,12 +441,21 @@@ WalReceiverMain(const void *startup_dat */ if (is_temp_slot) { - snprintf(slotname, sizeof(slotname), - "pg_walreceiver_%lld", - (long long int) walrcv_get_backend_pid(wrconn)); - + if (!temp_slot_created) + { + snprintf(slotname, sizeof(slotname), + "pg_walreceiver_%lld", + (long long int) walrcv_get_backend_pid(wrconn)); + + walrcv_create_slot(wrconn, slotname, true, false, false, 0, NULL); + ++<<<<<<< ours + temp_slot_created = true; + } ++======= + walrcv_create_slot(wrconn, slotname, true, false, false, true, NIL, + 0, NULL); ++>>>>>>> theirs SpinLockAcquire(&walrcv->mutex); strlcpy(walrcv->slotname, slotname, NAMEDATALEN); diff --cc src/test/recovery/meson.build index 72113c5ac6e,5162561bd27..00000000000 --- a/src/test/recovery/meson.build +++ b/src/test/recovery/meson.build @@@ -64,7 -64,7 +64,11 @@@ tests += 't/053_standby_login_event_trigger.pl', 't/054_unlogged_sequence_promotion.pl', 't/055_cascade_reconnect.pl', ++<<<<<<< ours + 't/056_standby_snapshot_export.pl', ++======= + 't/056_logical_slot_scope.pl', ++>>>>>>> theirs ], }, }