Re: Streaming replication and non-blocking I/O - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Streaming replication and non-blocking I/O
Date
Msg-id 4B26882D.8020708@enterprisedb.com
Whole thread Raw
In response to Re: Streaming replication and non-blocking I/O  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Streaming replication and non-blocking I/O  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Streaming replication and non-blocking I/O  (Fujii Masao <masao.fujii@gmail.com>)
List pgsql-hackers
Tom Lane wrote:
> The very, very large practical problem with this is that if you decide
> to change the behavior at any time, the only way to be sure that the WAL
> receiver is using the right libpq version is to perform a soname major
> version bump.  The transformations done by libpq will essentially become
> part of its ABI, and not a very visible part at that.

Not having to change the libpq API would certainly be a big advantage.

It's going to be a bit more complicated in walsender/walreceiver to work
with the libpq COPY API. We're going to need a WAL sending/receiving
protocol on top of it, defined in terms of rows and columns passed
through the COPY protocol.

One problem is the the standby is supposed to send back acknowledgments
to the master, telling it how far it has received/replayed the WAL. Is
there any way to send information back to the server, while a COPY OUT
is in progress? That's not absolutely necessary with asynchronous
replication, but will be with synchronous.

One idea is to stop/start the COPY between every batch of WAL records
sent, giving the client (= walreceiver) a chance to send messages back.
But that will lead to extra round trips.

BTW, something that's been bothering me a bit with this patch is that we
now have to link the backend with libpq. I don't see an immediate
problem with that, but I'm not a packager. Does anyone see a problem
with that?

--  Heikki Linnakangas EnterpriseDB   http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Andrew Gierth
Date:
Subject: Re: Aggregate ORDER BY patch
Next
From: Robert Haas
Date:
Subject: Re: Python 3.1 support