From: | Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> |
---|---|
To: | Andres Freund <andres(at)2ndquadrant(dot)com> |
Cc: | pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: walsender doesn't send keepalives when writes are pending |
Date: | 2014-02-22 03:38:39 |
Message-ID: | CAA4eK1L=6AtcV3+481Tpus3zNjGtWazsC8-QpOLpwGqOO65wKg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Fri, Feb 21, 2014 at 7:10 PM, Andres Freund <andres(at)2ndquadrant(dot)com> wrote:
> On 2014-02-21 19:03:29 +0530, Amit Kapila wrote:
>> On Fri, Feb 21, 2014 at 2:36 PM, Andres Freund <andres(at)2ndquadrant(dot)com> wrote:
>> > Well, especially on a pipelined connection, that can take a fair
>> > bit. TCP timeouts aren't fun.
>>
>> Okay, but the behaviour should be same for both keepalive message
>> and wal data it needs to send. What I mean to say here is that if n/w
>> is down, wal sender will detect it early by sending some data (either
>> keepalive or wal data). Also the ping is sent only after
>> wal_sender_timeout/2 w.r.t last reply time and wal data will be
>> sent after each sleeptime (1 + wal_sender_timeout/10) which
>> I think is should be lesser than the time to send ping.
>
> The danger is rather that *no* keepalive is sent (with requestReply =
> true triggering a reply by the client) by the walsender. Try to run
> pg_receivexlog against a busy server with a low walsender timeout. Since
> we'll never get to sending a keepalive we'll not trigger a reply by the
> receiver. Now
Looking at code of pg_receivexlog in function HandleCopyStream(),
it seems that it can only happen if user has not configured
--status-interval in pg_receivexlog. Code referred is as below:
HandleCopyStream()
{
..
/*
* Potentially send a status message to the master
*/
now = localGetCurrentTimestamp();
if (still_sending && standby_message_timeout > 0 &&
localTimestampDifferenceExceeds(last_status, now,
standby_message_timeout))
{
/* Time to send feedback! */
if (!sendFeedback(conn, blockpos, now, false))
goto error;
last_status = now;
}
Even if this is not happening due to some reason, shouldn't this be
anyway the responsibility of pg_receivexlog to send the status from time
to time rather than sending when server asked for it?
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com
From | Date | Subject | |
---|---|---|---|
Next Message | MauMau | 2014-02-22 04:44:19 | Re: [bug fix] postgres.exe fails to start on Windows Server 2012 due to ASLR |
Previous Message | Daniel Farina | 2014-02-22 02:50:30 | Re: Storing the password in .pgpass file in an encrypted format |