On Sat, Dec 31, 2011 at 10:34 PM, Simon Riggs <si...@2ndquadrant.com> wrote: > Send new protocol keepalive messages to standby servers. > Allows streaming replication users to calculate transfer latency > and apply delay via internal functions. No external functions yet.
pq_flush_if_writable() needs to be called just after WalSndKeepalive(). Otherwise, keepalive packet is not sent for a while. +static void +ProcessWalSndrMessage(XLogRecPtr walEnd, TimestampTz sendTime) walEnd is not used in ProcessWalSndrMessage() at all. Can't we remove it? If yes, walEnd field in WalSndrMessage is also not used anywhere, so ISTM we can remove it. + elog(DEBUG2, "sendtime %s receipttime %s replication apply delay %d transfer latency %d", + timestamptz_to_str(sendTime), + timestamptz_to_str(lastMsgReceiptTime), + GetReplicationApplyDelay(), + GetReplicationTransferLatency()); The unit of replication apply delay and transfer latency should be in log message. GetReplicationApplyDelay() and GetReplicationTransferLatency() are called whenever the standby receives the message from the master. Which might degrade the performance of replication a bit. So we should skip the above elog when log_message >= DEBUG2? Regards, -- Fujii Masao NIPPON TELEGRAPH AND TELEPHONE CORPORATION NTT Open Source Software Center -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers