Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix an oversight in format 2: nextlsn
Format 2 (1b0cbac) forgot to add nextlsn. Format 1 includes this information if include-lsn is provided. This information can be useful for applications that use LSN position as a restart point.
- Loading branch information
8600d48
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we heavily use wal2json, and there are no alternative to it at all (noone supports both insert/update/delete AND pg_logical_emit_message), I typically have lots of questions, hopefully valuable to be added to README's FAQ too or so.
Regarding this particular commit, I wonder if
nextlsn
is absolutely essential for position tracking, or is it just a "good to have in some cases" thing?Because in our codebase, I was able to successfully track the position based on just the "transaction commit" message's LSN emitted along with the PG binary replication protocol message (described in this comment: #172 (comment)). To me, it looks like "transaction commit" message has enough information for the proper tracking. I wonder how people use nextlsn in practice in a way which is not available via "transaction commit" LSN.
We anyway need to wait for the "transaction commit" message before storing the LSN locally for tracking purposes, otherwise we risk to lose the data. So why do we want nextlsn in the "transaction begin" message too? (I read the PRs and issues related to nextlsn in v1, but still couldn't figure out the answer to this).