Unverified Commit ef5dcaae authored by Dimitri Fontaine's avatar Dimitri Fontaine Committed by GitHub
Browse files

Fix SWITCH WAL and KEEPALIVE message handling in transform. (#208)

* Fix SWITCH WAL and KEEPALIVE message handling in transform.

The SWITCH WAL and KEEPALIVE messages both need to be written out by the
transform process as soon as it receives them when in streaming mode. That
includes flushing a current transaction out to the apply process and then
continuing with that same transaction across the WAL file boundary for
instance.

In passing, improve error handling on the return value of the fformat()
call, so that we stop processing messages early in case of a problem there.

Also, refrain from processing keepalive messages unless the server is
requesting for a reply. That reduces the amount of KEEPALIVE messages
drastically, which is a good thing.

Finally, the main follow loop must verify if we reached endpos after the
intermediate catchup at mode switching.

* Fix snapshot re-use from command line and workdir file.

In particular, make sure to remove the file on-disk when we close the
snapshot, in order to stop trying to re-use a snapshot that no longer
exists.

* Fix transform for transactions that spans multiple JSON files.
parent 831cf427
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