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

Поиск
Список
Период
Сортировка
От Fujii Masao
Тема Re: [COMMITTERS] pgsql: Send new protocol keepalive messages to standby servers.
Дата
Msg-id CAHGQGwFTfgq4sqdF=QEWnH2pk-n1Kd5cKzoWNY7u6cvxdFYAaA@mail.gmail.com
обсуждение исходный текст
Ответы Re: [COMMITTERS] pgsql: Send new protocol keepalive messages to standby servers.  (Simon Riggs <simon@2ndQuadrant.com>)
Список 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 по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: JSON for PG 9.2
Следующее
От: Greg Smith
Дата:
Сообщение: Re: checkpoint writeback via sync_file_range