Skip to main content

Module state

Module state 

Source
Expand description

Bookmark <-> JSON serialization for replication slot LSN progress.

Bookmark shape (round-trips through serde_json::Value):

{ "last_lsn": "0/16A4F88" }

last_lsn is the end_lsn of the last committed transaction whose change records have been written to the sink — the WAL position immediately after that commit record, i.e. exactly where the next START_REPLICATION resumes. (It is the commit’s end_lsn, not its commit_lsn; see the persist site in stream.rs.)

Structs§

Bookmark
Durable bookmark for a PostgresCdcSource.

Functions§

format_lsn
Format a u64 LSN into Postgres’ XXXXXXXX/XXXXXXXX text form, dropping leading zeros from each half (matches pg_lsn::out).
parse_lsn
Parse XXXX/XXXX (case-insensitive hex, no leading zeros required) into a u64. Returns FaucetError::State on any malformation.
state_key
Generate the state_key for a given replication slot.