Skip to content

Commit

Permalink
Enhanced logging of restarting from last confirmed flush which now ma…
Browse files Browse the repository at this point in the history
…y provide information about the alternative position in offset
  • Loading branch information
noctarius committed Jul 6, 2023
1 parent 47a5403 commit 8cae860
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/replication/context/replicationconnection.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,11 @@ func (rc *ReplicationConnection) locateRestartLSN(readReplicationSlot readReplic
}

if restartLSN == confirmedFlushLSN && !rc.replicationSlotCreated {
rc.logger.Infof("Restarting replication at last confirmed flush LSN: %s", restartLSN)
addMsg := ""
if offset != nil {
addMsg = fmt.Sprintf(" (lower offset LSN: %s)", offset.LSN.String())
}
rc.logger.Infof("Restarting replication at last confirmed flush LSN: %s%s", restartLSN, addMsg)
} else if offset != nil && restartLSN == offset.LSN {
rc.logger.Infof("Restarting replication at last LSN in offset storage: %s", restartLSN)
} else {
Expand Down

0 comments on commit 8cae860

Please sign in to comment.