On Thu, Nov 2, 2017 at 9:59 AM, Steve Atkins <steve@xxxxxxxxxxx> wrote:
Where are the errors coming from - your code or pgx? If it's from pgx, what's the exact error? ('w' is regular replication payload data, so it'd be expected as a copydata payload message type, but would be an error for a replication message).
The errors are coming from PGX. Best I can tell (and I'm not very familiar with the PGX code, nor with the internals of Postgres replication), it's waiting for a replication message from the backend, so it's expecting things like CopyData/CopyInResponse/CopyOutResponse/CopyBothResponse. It gets a 'w' msg type there, which it doesn't handle, so it errors back to me (the copydata message type it expects there is 'd').
I'm only using PGX to open a replication connection, start replication, read replication messages and send heartbeats.
I did open an issue on GitHub about this a couple of days ago, but haven't heard back from the PGX developer, so I thought I should try to help out and debug it myself. So I've been trying to educate myself on replication internals and such. Hence my email here.
Do you capture the raw data from the replication connection when the error happens?
I was not, but I have added that and some other logging, and will report back when I get more info.
Thanks,
Mark