=== Applying patches on top of PostgreSQL commit ID 29f7ce6fe78e3f8d520764b5870453d791a3ca65 === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Tue May 20 00:32:21 UTC 2025 On branch cf/5627 nothing to commit, working tree clean === using 'git am' to apply patch ./0001-Add-injection-points-to-test-replication-slot-advanc.v2.patch === Applying: Add injection points to test replication slot advance Using index info to reconstruct a base tree... M src/backend/access/transam/xlog.c M src/backend/replication/logical/logical.c Falling back to patching base and 3-way merge... Auto-merging src/backend/replication/logical/logical.c CONFLICT (content): Merge conflict in src/backend/replication/logical/logical.c Auto-merging src/backend/access/transam/xlog.c 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 injection points to test replication slot advance 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 src/backend/access/transam/xlog.c M src/backend/replication/logical/logical.c === using patch(1) to apply patch ./0001-Add-injection-points-to-test-replication-slot-advanc.v2.patch === patching file src/backend/access/transam/xlog.c patching file src/backend/replication/logical/logical.c Hunk #3 FAILED at 1827. Hunk #4 succeeded at 1883 (offset 12 lines). 1 out of 4 hunks FAILED -- saving rejects to file src/backend/replication/logical/logical.c.rej Unstaged changes after reset: M src/backend/access/transam/xlog.c M src/backend/replication/logical/logical.c Removing src/backend/replication/logical/logical.c.rej === using 'git apply' to apply patch ./0001-Add-injection-points-to-test-replication-slot-advanc.v2.patch === Applied patch to 'src/backend/access/transam/xlog.c' cleanly. Applied patch to 'src/backend/replication/logical/logical.c' with conflicts. U src/backend/replication/logical/logical.c diff --cc src/backend/replication/logical/logical.c index 1d56d0c4ef3,2163dc5e275..00000000000 --- a/src/backend/replication/logical/logical.c +++ b/src/backend/replication/logical/logical.c @@@ -1828,19 -1831,10 +1831,26 @@@ LogicalConfirmReceivedLocation(XLogRecP SpinLockAcquire(&MyReplicationSlot->mutex); ++<<<<<<< ours + /* + * Prevent moving the confirmed_flush backwards, as this could lead to + * data duplication issues caused by replicating already replicated + * changes. + * + * This can happen when a client acknowledges an LSN it doesn't have + * to do anything for, and thus didn't store persistently. After a + * restart, the client can send the prior LSN that it stored + * persistently as an acknowledgement, but we need to ignore such an + * LSN. See similar case handling in CreateDecodingContext. + */ + if (lsn > MyReplicationSlot->data.confirmed_flush) + MyReplicationSlot->data.confirmed_flush = lsn; ++======= + /* remember the old restart lsn */ + restart_lsn = MyReplicationSlot->data.restart_lsn; + + MyReplicationSlot->data.confirmed_flush = lsn; ++>>>>>>> theirs /* if we're past the location required for bumping xmin, do so */ if (MyReplicationSlot->candidate_xmin_lsn != InvalidXLogRecPtr &&