Re: walsender doesn't send keepalives when writes are pending - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: walsender doesn't send keepalives when writes are pending
Date
Msg-id CAA4eK1JwLF_CjguQkWn+4n9fhZwScyUWmm2D7iU8XaFWsLNs3A@mail.gmail.com
Whole thread Raw
In response to Re: walsender doesn't send keepalives when writes are pending  (Andres Freund <andres@2ndquadrant.com>)
Responses Re: walsender doesn't send keepalives when writes are pending  (Andres Freund <andres@2ndquadrant.com>)
List pgsql-hackers
On Fri, Feb 21, 2014 at 2:36 PM, Andres Freund <andres@2ndquadrant.com> wrote:
> On 2014-02-21 10:08:44 +0530, Amit Kapila wrote:
>>
>> I think the main reason of ping is to detect n/w break sooner.
>> On a busy server, wouldn't WALSender can detect it when next time it
>> will try to send the remaining data?
>
> 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.


> There's a reason we have the keepalives,
> and that they measure application to application performance.

Do you mean to say the info about receiver (uphill what it has flushed..)?
If yes, then won't we get this information in other reply message or
sending keepalive will achieve any other purpose (may be it can get
info more quickly)?

> And
> detecting systems as down is important for e.g. synchronous rep.

If you are right, then I am missing some point which is how on a
busy server sending keepalive can detect n/w break more quickly
then current way.

With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Changeset Extraction v7.6.1
Next
From: Andres Freund
Date:
Subject: Re: walsender doesn't send keepalives when writes are pending