MCPcopy Create free account
hub / github.com/dolthub/doltgresql / readWALPosition

Method readWALPosition

server/logrepl/replication.go:772–783  ·  view source on GitHub ↗

readWALPosition reads the recorded WAL position from the WAL position file

()

Source from the content-addressed store, hash-verified

770
771// readWALPosition reads the recorded WAL position from the WAL position file
772func (r *LogicalReplicator) readWALPosition() (pglogrepl.LSN, error) {
773 walFileContents, err := os.ReadFile(r.walFilePath)
774 if err != nil {
775 // if the file doesn't exist, consider this a cold start and return 0
776 if os.IsNotExist(err) {
777 return pglogrepl.LSN(0), nil
778 }
779 return 0, err
780 }
781
782 return pglogrepl.ParseLSN(string(walFileContents))
783}
784
785// writeWALPosition writes the recorded WAL position to the WAL position file
786func (r *LogicalReplicator) writeWALPosition(lsn pglogrepl.LSN) error {

Callers 1

StartReplicationMethod · 0.95

Calls 1

ReadFileMethod · 0.45

Tested by

no test coverage detected