=== Applying patches on top of PostgreSQL commit ID 5424f4da9031ac4681ab002d20f021232070c96a === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Mon Dec 1 06:21:21 UTC 2025 On branch cf/6082 nothing to commit, working tree clean === using 'git am' to apply patch ./v16-0001-Add-slotsync_skip_reason-to-pg_replication_slots.patch === Applying: Add slotsync_skip_reason to pg_replication_slots Using index info to reconstruct a base tree... M doc/src/sgml/monitoring.sgml M doc/src/sgml/system-views.sgml M src/backend/catalog/system_views.sql M src/backend/replication/logical/slotsync.c M src/backend/replication/slot.c M src/backend/replication/slotfuncs.c M src/backend/utils/activity/pgstat_replslot.c M src/include/catalog/pg_proc.dat M src/include/replication/slot.h M src/test/recovery/t/040_standby_failover_slots_sync.pl 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/include/replication/slot.h CONFLICT (content): Merge conflict in src/include/replication/slot.h Auto-merging doc/src/sgml/system-views.sgml CONFLICT (content): Merge conflict in doc/src/sgml/system-views.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 Add slotsync_skip_reason to pg_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". Unstaged changes after reset: M doc/src/sgml/system-views.sgml M src/include/replication/slot.h === using patch(1) to apply patch ./v16-0001-Add-slotsync_skip_reason-to-pg_replication_slots.patch === patching file doc/src/sgml/monitoring.sgml Hunk #1 FAILED at 1665. Hunk #2 FAILED at 1677. 2 out of 2 hunks FAILED -- saving rejects to file doc/src/sgml/monitoring.sgml.rej patching file doc/src/sgml/system-views.sgml Hunk #1 succeeded at 4315 (offset 1213 lines). patching file src/backend/catalog/system_views.sql Hunk #1 FAILED at 1060. 1 out of 1 hunk FAILED -- saving rejects to file src/backend/catalog/system_views.sql.rej patching file src/backend/replication/logical/slotsync.c Hunk #1 succeeded at 148 with fuzz 2. Hunk #2 FAILED at 199. Hunk #3 FAILED at 217. Hunk #4 FAILED at 315. Hunk #5 FAILED at 725. Hunk #6 FAILED at 740. Hunk #7 FAILED at 841. 6 out of 7 hunks FAILED -- saving rejects to file src/backend/replication/logical/slotsync.c.rej patching file src/backend/replication/slot.c Hunk #1 FAILED at 491. 1 out of 1 hunk FAILED -- saving rejects to file src/backend/replication/slot.c.rej patching file src/backend/replication/slotfuncs.c Hunk #1 succeeded at 24 with fuzz 2. Hunk #2 FAILED at 246. Hunk #3 succeeded at 470 with fuzz 2 (offset 16 lines). 1 out of 3 hunks FAILED -- saving rejects to file src/backend/replication/slotfuncs.c.rej patching file src/backend/utils/activity/pgstat_replslot.c Hunk #1 FAILED at 115. 1 out of 1 hunk FAILED -- saving rejects to file src/backend/utils/activity/pgstat_replslot.c.rej patching file src/include/catalog/pg_proc.dat Hunk #1 FAILED at 11519. 1 out of 1 hunk FAILED -- saving rejects to file src/include/catalog/pg_proc.dat.rej patching file src/include/replication/slot.h Hunk #1 succeeded at 71 with fuzz 2. Hunk #2 FAILED at 266. 1 out of 2 hunks FAILED -- saving rejects to file src/include/replication/slot.h.rej patching file src/test/recovery/t/040_standby_failover_slots_sync.pl Hunk #1 succeeded at 1055 with fuzz 2 (offset 6 lines). patching file src/test/regress/expected/rules.out Hunk #1 FAILED at 1507. 1 out of 1 hunk FAILED -- saving rejects to file src/test/regress/expected/rules.out.rej patching file src/tools/pgindent/typedefs.list Hunk #1 FAILED at 2807. 1 out of 1 hunk FAILED -- saving rejects to file src/tools/pgindent/typedefs.list.rej Unstaged changes after reset: M doc/src/sgml/system-views.sgml M src/backend/replication/logical/slotsync.c M src/backend/replication/slotfuncs.c M src/include/replication/slot.h M src/test/recovery/t/040_standby_failover_slots_sync.pl Removing doc/src/sgml/monitoring.sgml.rej Removing src/backend/catalog/system_views.sql.rej Removing src/backend/replication/logical/slotsync.c.rej Removing src/backend/replication/slot.c.rej Removing src/backend/replication/slotfuncs.c.rej Removing src/backend/utils/activity/pgstat_replslot.c.rej Removing src/include/catalog/pg_proc.dat.rej Removing src/include/replication/slot.h.rej Removing src/test/regress/expected/rules.out.rej Removing src/tools/pgindent/typedefs.list.rej === using 'git apply' to apply patch ./v16-0001-Add-slotsync_skip_reason-to-pg_replication_slots.patch === Applied patch to 'doc/src/sgml/monitoring.sgml' cleanly. Applied patch to 'doc/src/sgml/system-views.sgml' with conflicts. Applied patch to 'src/backend/catalog/system_views.sql' cleanly. Applied patch to 'src/backend/replication/logical/slotsync.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/utils/activity/pgstat_replslot.c' cleanly. Applied patch to 'src/include/catalog/pg_proc.dat' cleanly. Applied patch to 'src/include/replication/slot.h' with conflicts. Applied patch to 'src/test/recovery/t/040_standby_failover_slots_sync.pl' cleanly. Applied patch to 'src/test/regress/expected/rules.out' cleanly. Applied patch to 'src/tools/pgindent/typedefs.list' cleanly. U doc/src/sgml/system-views.sgml U src/include/replication/slot.h diff --cc doc/src/sgml/system-views.sgml index 7db8f73eba2,1fbf83079f0..00000000000 --- a/doc/src/sgml/system-views.sgml +++ b/doc/src/sgml/system-views.sgml @@@ -3138,8 -3138,7 +3138,12 @@@ SELECT * FROM pg_locks pl LEFT JOIN pg_ ++<<<<<<< ours + slot_invalidated means that the synced slot is + invalidated. ++======= + slot_invalidated means that the slot is invalidated. ++>>>>>>> theirs diff --cc src/include/replication/slot.h index 28251d86638,01d949bb3c1..00000000000 --- a/src/include/replication/slot.h +++ b/src/include/replication/slot.h @@@ -72,10 -72,9 +72,16 @@@ typedef enum ReplicationSlotInvalidatio #define RS_INVAL_MAX_CAUSES 4 /* ++<<<<<<< ours + * When the slot synchronization worker is running, or when + * pg_sync_replication_slots is executed, slot synchronization may be + * skipped. This enum defines the possible reasons for skipping slot + * synchronization. ++======= + * When slot sync worker is running or pg_sync_replication_slots is run, the + * slot sync can be skipped. This enum keeps a list of reasons of slot sync + * skip. ++>>>>>>> theirs */ typedef enum SlotSyncSkipReason { @@@ -268,15 -267,13 +274,25 @@@ typedef struct ReplicationSlo XLogRecPtr last_saved_restart_lsn; /* ++<<<<<<< ours + * Reason for the most recent slot synchronization skip. + * + * Slot sync skips can occur for both temporary and persistent replication + * slots. They are more common for temporary slots, but persistent slots + * may also skip synchronization in rare cases (e.g., + * SS_SKIP_WAL_NOT_FLUSHED or SS_SKIP_WAL_OR_ROWS_REMOVED). + * + * Since, temporary slots are dropped after server restart, persisting + * slotsync_skip_reason provides no practical benefit. ++======= + * The reason for last slot sync skip. + * + * A slotsync skip typically occurs only for temporary slots. For + * persistent slots it is extremely rare (e.g., cases like + * SS_SKIP_WAL_NOT_FLUSHED or SS_SKIP_WAL_OR_ROWS_REMOVED). Since, + * temporary slots are dropped after server restart, so there is no value + * in persisting the slotsync_skip_reason. ++>>>>>>> theirs */ SlotSyncSkipReason slotsync_skip_reason; } ReplicationSlot;