Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WW1H8-0001XX-6n for pgsql-bugs@arkaria.postgresql.org; Fri, 04 Apr 2014 10:23:06 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WW1H7-0001EC-NB for pgsql-bugs@arkaria.postgresql.org; Fri, 04 Apr 2014 10:23:05 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WW1H6-0001E5-QJ for pgsql-bugs@postgresql.org; Fri, 04 Apr 2014 10:23:04 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WW1H4-0002Vh-F2 for pgsql-bugs@postgresql.org; Fri, 04 Apr 2014 10:23:04 +0000 MIME-Version: 1.0 Subject: BUG #9849: walreceiver's DEBUG message reports wrong timestamp To: pgsql-bugs@postgresql.org From: harukat@sraoss.co.jp Date: Fri, 04 Apr 2014 10:22:16 +0000 Message-ID: <20140404102216.322.99900@wrigleys.postgresql.org> X-Pg-Spam-Score: -1.9 (-) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org The following bug has been logged on the website: Bug reference: 9849 Logged by: TAKATSUKA Haruka Email address: harukat@sraoss.co.jp PostgreSQL version: 9.3.4 Operating system: CentOS 6.2 (64bit / gcc 4.4.7) Description: We get the folloging message at the standby server. DEBUG: sendtime 2014-04-04 11:26:02.425368+09 receipttime 2014-04-04 11:26:02.425368+09 replication apply delay 0 ms transfer latency 224043 ms Though sendtime equals receipttime, transfer latency is large. This receipttime may be wrong. When I change the code as the following for as a trial, messages that have same sendtime and receipttime are gone. diff --git a/src/backend/replication/walreceiver.c b/src/backend/replication/wal index 43db108..af21b5d 100644 --- a/src/backend/replication/walreceiver.c +++ b/src/backend/replication/walreceiver.c @@ -1198,10 +1198,13 @@ ProcessWalSndrMessage(XLogRecPtr walEnd, TimestampTz sen walrcv->lastMsgReceiptTime = lastMsgReceiptTime; SpinLockRelease(&walrcv->mutex); - if (log_min_messages <= DEBUG2) + if (log_min_messages <= DEBUG2) { + char* strSendTime = strdupa(timestamptz_to_str(sendTime)); + char* strReceiptTime = strdupa(timestamptz_to_str(lastMsgReceipt + int applyDelay = GetReplicationApplyDelay(); + int transferLatency = GetReplicationTransferLatency(); + elog(DEBUG2, "sendtime %s receipttime %s replication apply delay - timestamptz_to_str(sendTime), - timestamptz_to_str(lastMsgReceiptTime), - GetReplicationApplyDelay(), - GetReplicationTransferLatency()); + strSendTime, strReceiptTime, applyDelay, transferLatenc + } } -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs