Skip site navigation (1) Skip section navigation (2)

Re: [COMMITTERS] pgsql: Send new protocol keepalive messages to standby servers.

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [COMMITTERS] pgsql: Send new protocol keepalive messages to standby servers.
Date: 2012-01-11 14:05:46
Message-ID: CAHGQGwFTfgq4sqdF=QEWnH2pk-n1Kd5cKzoWNY7u6cvxdFYAaA@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-committerspgsql-hackers
On Sat, Dec 31, 2011 at 10:34 PM, Simon Riggs <simon(at)2ndquadrant(dot)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

In response to

Responses

pgsql-hackers by date

Next:From: Greg SmithDate: 2012-01-11 14:12:30
Subject: Re: checkpoint writeback via sync_file_range
Previous:From: Robert HaasDate: 2012-01-11 14:04:25
Subject: Re: JSON for PG 9.2

pgsql-committers by date

Next:From: Simon RiggsDate: 2012-01-11 15:20:24
Subject: Re: [COMMITTERS] pgsql: Send new protocol keepalive messages to standby servers.
Previous:From: Heikki LinnakangasDate: 2012-01-11 09:28:25
Subject: pgsql: Refactor XLogInsert a bit. The rdata entries for backup blocksa

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group