Skip to content

Commit

Permalink
Log the replication slot's confirmed_flush LSN when it is saved
Browse files Browse the repository at this point in the history
Useful when skimming logs to understand what data the consumer has
already received.

Signed-off-by: Tristan Partin <tristan@partin.io>
  • Loading branch information
tristan957 committed Nov 11, 2024
1 parent 2199b83 commit ea70383
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/backend/replication/slot.c
Original file line number Diff line number Diff line change
Expand Up @@ -1584,7 +1584,11 @@ SaveSlotToPath(ReplicationSlot *slot, const char *dir, int elevel)
/* NEON specific: persist slot in storage using logical message */
char prefix[MAXPGPATH];
snprintf(prefix, sizeof(prefix), "neon-file:%s", path);
elog(LOG, "Save replication slot at %s restart_lsn=%X/%X", path, LSN_FORMAT_ARGS(cp.slotdata.restart_lsn));
elog(LOG,
"Save replication slot at %s restart_lsn=%X/%X confirmed_flush=%X/%X",
path,
LSN_FORMAT_ARGS(cp.slotdata.restart_lsn),
LSN_FORMAT_ARGS(cp.slotdata.confirmed_flush));
XLogFlush(LogLogicalMessage(prefix, (char*)&cp, sizeof cp, false));
}

Expand Down

0 comments on commit ea70383

Please sign in to comment.