Re: walsender doesn't send keepalives when writes are pending

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-21 13:33:29
Message-ID: CAA4eK1JwLF_CjguQkWn+4n9fhZwScyUWmm2D7iU8XaFWsLNs3A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Feb 21, 2014 at 2:36 PM, Andres Freund <andres(at)2ndquadrant(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2014-02-21 13:40:10 Re: walsender doesn't send keepalives when writes are pending
Previous Message Andres Freund 2014-02-21 13:27:33 Re: Changeset Extraction v7.6.1