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

From: Greg Stark <stark(at)mit(dot)edu>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: walsender doesn't send keepalives when writes are pending
Date: 2014-02-14 12:55:06
Message-ID: CAM-w4HNmk9hk+Okc331Yy9fwnwMkrbg=BftpPfXE5LzUpNed+g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Feb 14, 2014 at 12:05 PM, Andres Freund <andres(at)2ndquadrant(dot)com> wrote:
> There's no reason not
> to ask for a ping when we're writing.

Is there a reason to ask for a ping? The point of keepalives is to
ensure there's some traffic on idle connections so that if the
connection is dead it doesn't linger forever and so that any on-demand
links (or more recently NAT routers or stateful firewalls) don't time
out and disconnect and have to reconnect (or more recently just fail
outright).

By analogy TCP doesn't send any keepalives if there is any traffic on
the link. On the other hand I happen to know (the hard way) that
typical PPPoE routers *do* send LCP pings even when the link is busy
so there's precedent for either behaviour. I'm guess it comes down to
why you want the keepalives.

--
greg

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2014-02-14 12:57:33 Re: HBA files w/include support?
Previous Message Florian Pflug 2014-02-14 12:52:45 Re: Memory ordering issue in LWLockRelease, WakeupWaiters, WALInsertSlotRelease