Unverified Commit 2de9c9d6 authored by Dimitri Fontaine's avatar Dimitri Fontaine
Browse files

Refrain from using wal2json computed column "nextlsn".

This column isn't part of Postgres Logical Decoding API and relying on it
would prevent pgcopydb from being compatible with other output plugins in
the future.

Also, our internal tracking of the LSN position was pretty confused at
times, using a single LSN value makes it simpler to follow our logic.

To still be able to follow WAL filename changes we introduce the SWITCH WAL
statement in our SQL files too, not just the JSON files anymore. The replay
process knows how to parse those SWITCH WAL statements.

To still be able to match our endpos with the actual LSN position in the
WAL, we introduce a new KEEPALIVE statement in our SQL and JSON files too.
The replay process knows how to parse those KEEPALIVE statements and mark
the progress on the replication origin tracking on the target database.
parent 8cc18823
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment