Skip to content

Commit 044b319

Browse files
committed
Fix some comments related to logical repslot advancing
confirmed_flush is part of a replication slot's information, but not confirmed_lsn. Author: Kyotaro Horiguchi Discussion: https://postgr.es/m/20191226.175919.17237335658671970.horikyota.ntt@gmail.com Backpatch-through: 11
1 parent 1ab41a3 commit 044b319

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/backend/replication/slotfuncs.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,8 @@ pg_physical_replication_slot_advance(XLogRecPtr moveto)
378378
/*
379379
* Helper function for advancing our logical replication slot forward.
380380
*
381-
* The slot's restart_lsn is used as start point for reading records,
382-
* while confirmed_lsn is used as base point for the decoding context.
381+
* The slot's restart_lsn is used as start point for reading records, while
382+
* confirmed_flush is used as base point for the decoding context.
383383
*
384384
* We cannot just do LogicalConfirmReceivedLocation to update confirmed_flush,
385385
* because we need to digest WAL to advance restart_lsn allowing to recycle
@@ -549,8 +549,8 @@ pg_replication_slot_advance(PG_FUNCTION_ARGS)
549549
/*
550550
* Check if the slot is not moving backwards. Physical slots rely simply
551551
* on restart_lsn as a minimum point, while logical slots have confirmed
552-
* consumption up to confirmed_lsn, meaning that in both cases data older
553-
* than that is not available anymore.
552+
* consumption up to confirmed_flush, meaning that in both cases data
553+
* older than that is not available anymore.
554554
*/
555555
if (OidIsValid(MyReplicationSlot->data.database))
556556
minlsn = MyReplicationSlot->data.confirmed_flush;

0 commit comments

Comments
 (0)