I’m using CNPG Postgres with 2 node availability. There’s a primary and secondary. The primary uses synchronous replication. I am using Change Data Capture with debezium. It creates a replication slot, reads from the WAL, and then handles each event.
My understanding of WAL positions is that they are identified by a Logical Sequence Number (LSN).
Let’s say the latest LSN on the primary has LSN=A.
At this point, failover happens, where the secondary becomes the primary and then a new replication slot is created. The former primary hasn’t yet read LSN of A. Will the LSN on the primary (formerly secondary) still contain A?
In other words, do the LSNs match between a primary and secondary? Or do they vary per database?