Re: [COMMITTERS] pgsql: Send new protocol keepalive messages to standby servers. - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: [COMMITTERS] pgsql: Send new protocol keepalive messages to standby servers.
Date
Msg-id CAHGQGwFTfgq4sqdF=QEWnH2pk-n1Kd5cKzoWNY7u6cvxdFYAaA@mail.gmail.com
Whole thread Raw
Responses Re: [COMMITTERS] pgsql: Send new protocol keepalive messages to standby servers.  (Simon Riggs <simon@2ndQuadrant.com>)
List pgsql-hackers
On Sat, Dec 31, 2011 at 10:34 PM, Simon Riggs <simon@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


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: JSON for PG 9.2
Next
From: Greg Smith
Date:
Subject: Re: checkpoint writeback via sync_file_range