Streaming Replication and CopyOutResponse message

Fujii Masao <masao.fujii@gmail.com>

From: Fujii Masao <masao.fujii@gmail.com>
To: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2010-03-26T09:30:32Z
Lists: pgsql-hackers

Attachments

Hi,

At the end of the handshake for replication, a CopyOutResponse
message might not arrive at the standby for a while if there is
no WAL record to send. Also walreceiver would get stuck until
that message has arrived. This is not a big problem, but should
be fixed.

The cause is that walsender hasn't called pq_flush() there.
The attached patch changes walsender so as to call pg_flush()
immediately when sending that message. Is it worth applying
the patch?

Regards,

-- 
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center