walrcv->lastMsgReceiptTime = lastMsgReceiptTime;
SpinLockRelease(&walrcv->mutex);
- elog(DEBUG2, "sendtime %s receipttime %s replication apply delay %d transfer latency %d",
+ if (log_min_mesages <= DEBUG2)
+ elog(DEBUG2, "sendtime %s receipttime %s replication apply delay %d ms transfer latency %d ms",
timestamptz_to_str(sendTime),
timestamptz_to_str(lastMsgReceiptTime),
GetReplicationApplyDelay(),
if (pq_is_send_pending())
wakeEvents |= WL_SOCKET_WRITEABLE;
else
+ {
WalSndKeepalive(output_message);
+ /* Try to flush pending output to the client */
+ if (pq_flush_if_writable() != 0)
+ break;
+ }
/* Determine time until replication timeout */
if (replication_timeout > 0)