=== Applying patches on top of PostgreSQL commit ID a7f8cd811d65d1a51be87bdb890d7ebf7d49aa45 === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Mon Oct 5 03:49:31 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 doc/src/sgml/func/func-admin.sgml M doc/src/sgml/protocol.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/logical/logicalctl.c M src/backend/replication/logical/reorderbuffer.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/walreceiver.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/utils/guc_hooks.h M src/include/utils/rel.h M src/test/recovery/meson.build M src/test/regress/expected/oidjoins.out M src/test/regress/expected/rules.out 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/regress/expected/rules.out Auto-merging src/test/regress/expected/oidjoins.out Auto-merging src/test/recovery/meson.build CONFLICT (content): Merge conflict in src/test/recovery/meson.build Auto-merging src/include/utils/rel.h Auto-merging src/include/utils/guc_hooks.h Auto-merging src/include/catalog/pg_subscription.h Auto-merging src/include/catalog/pg_proc.dat Auto-merging src/include/catalog/pg_class.h Auto-merging src/include/catalog/meson.build Auto-merging src/include/catalog/Makefile Auto-merging src/include/access/xlog.h Auto-merging src/bin/pg_dump/t/002_pg_dump.pl Auto-merging src/bin/pg_dump/pg_dump.h Auto-merging src/bin/pg_dump/pg_dump.c Auto-merging src/backend/utils/misc/guc_tables.c Auto-merging src/backend/utils/misc/guc_parameters.dat Auto-merging src/backend/utils/init/postinit.c Auto-merging src/backend/replication/walsender.c Auto-merging src/backend/replication/walreceiver.c CONFLICT (content): Merge conflict in src/backend/replication/walreceiver.c Auto-merging src/backend/replication/slot.c Auto-merging src/backend/replication/pgoutput/pgoutput.c Auto-merging src/backend/replication/logical/tablesync.c Auto-merging src/backend/replication/logical/reorderbuffer.c CONFLICT (content): Merge conflict in src/backend/replication/logical/reorderbuffer.c Auto-merging src/backend/replication/logical/logicalctl.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/commands/publicationcmds.c Auto-merging src/backend/catalog/toasting.c Auto-merging src/backend/catalog/system_views.sql Auto-merging src/backend/catalog/pg_subscription.c Auto-merging src/backend/catalog/heap.c Auto-merging src/backend/access/transam/xlog.c Auto-merging src/backend/access/heap/heapam.c Auto-merging doc/src/sgml/system-views.sgml Auto-merging doc/src/sgml/ref/create_subscription.sgml Auto-merging doc/src/sgml/protocol.sgml Auto-merging doc/src/sgml/func/func-admin.sgml 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 #1 succeeded at 255 (offset -25 lines). Hunk #2 succeeded at 2123 (offset -13 lines). Hunk #3 succeeded at 7190 (offset 38 lines). Hunk #4 succeeded at 8242 (offset -506 lines). patching file doc/src/sgml/config.sgml Hunk #1 succeeded at 12454 (offset 1 line). patching file doc/src/sgml/func/func-admin.sgml patching file doc/src/sgml/protocol.sgml Hunk #1 succeeded at 2435 (offset -11 lines). 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 Hunk #1 succeeded at 2138 (offset 2 lines). patching file src/backend/access/transam/xlog.c Hunk #1 succeeded at 5471 (offset 221 lines). patching file src/backend/catalog/heap.c Hunk #3 succeeded at 971 (offset 1 line). Hunk #4 succeeded at 1045 (offset 1 line). Hunk #5 succeeded at 1544 (offset -1 lines). Hunk #6 succeeded at 1866 (offset -1 lines). patching file src/backend/catalog/pg_subscription.c patching file src/backend/catalog/system_views.sql Hunk #2 succeeded at 1546 (offset 4 lines). patching file src/backend/catalog/toasting.c Hunk #1 succeeded at 30 with fuzz 1. Hunk #2 succeeded at 458 (offset 60 lines). patching file src/backend/commands/publicationcmds.c Hunk #2 succeeded at 2042 (offset 5 lines). Hunk #3 succeeded at 2056 (offset 5 lines). Hunk #4 succeeded at 2066 (offset 5 lines). Hunk #5 succeeded at 2128 (offset 5 lines). 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 1765 (offset 10 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 3619 (offset -41 lines). Hunk #4 succeeded at 19741 (offset -69 lines). patching file src/backend/postmaster/autovacuum.c Hunk #2 succeeded at 2708 (offset 40 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 Hunk #1 succeeded at 1428 (offset 5 lines). patching file src/backend/replication/pgoutput/pgoutput.c patching file src/backend/replication/slot.c Hunk #11 succeeded at 1141 (offset 8 lines). Hunk #12 succeeded at 1567 (offset 8 lines). Hunk #13 succeeded at 1590 (offset 8 lines). Hunk #14 succeeded at 1651 (offset 8 lines). Hunk #15 succeeded at 1696 (offset 8 lines). Hunk #16 succeeded at 2777 (offset 8 lines). Hunk #17 succeeded at 2846 (offset 8 lines). Hunk #18 succeeded at 2999 (offset 8 lines). 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 Hunk #2 succeeded at 1241 (offset 1 line). patching file src/backend/utils/misc/guc_parameters.dat Hunk #1 succeeded at 2580 (offset 1 line). patching file src/backend/utils/misc/guc_tables.c patching file src/bin/pg_dump/pg_dump.c Hunk #1 succeeded at 5134 (offset -2 lines). Hunk #2 succeeded at 5214 (offset -2 lines). Hunk #3 succeeded at 5283 (offset -2 lines). Hunk #4 succeeded at 5325 (offset -2 lines). Hunk #5 succeeded at 5602 (offset -2 lines). patching file src/bin/pg_dump/pg_dump.h Hunk #1 succeeded at 718 (offset -2 lines). patching file src/bin/pg_dump/t/002_pg_dump.pl Hunk #1 succeeded at 3305 (offset -12 lines). patching file src/include/access/xlog.h patching file src/include/catalog/Makefile Hunk #1 succeeded at 80 with fuzz 2. patching file src/include/catalog/meson.build Hunk #1 succeeded at 67 with fuzz 1. patching file src/include/catalog/pg_class.h patching file src/include/catalog/pg_proc.dat Hunk #1 succeeded at 11730 (offset -3 lines). 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 Hunk #1 succeeded at 61 (offset -1 lines). patching file src/include/utils/rel.h Hunk #1 succeeded at 736 (offset 27 lines). Hunk #2 succeeded at 747 (offset 27 lines). 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 1673 (offset -25 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 94112c30501,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 ebb12dd8766,5162561bd27..00000000000 --- a/src/test/recovery/meson.build +++ b/src/test/recovery/meson.build @@@ -64,8 -64,7 +64,12 @@@ 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/057_snapshot_commit_race.pl', ++======= + 't/056_logical_slot_scope.pl', ++>>>>>>> theirs ], }, }