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

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(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 09:39:16
Message-ID: 20140222093916.GC30593@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2014-02-22 09:08:39 +0530, Amit Kapila wrote:
> > 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:

The interval interval is configured independently from the primary and
pg_receivexlog doesn't tune it automatically to the one configured for
the walsender.

> 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?

It does. At it's own interval. I don't see what's to discuss here,
sorry. There's really barely any cost to doing the keepalive correctly,
otherwise it'd be problematic in the half dozen cases where *we* do send
it. The keepalive mechanism doesn't work in one edgecase. So, let's fix
it, and not discuss why we think the entire mechanism might be useless.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2014-02-22 09:47:50 Re: Patch: show relation and tuple infos of a lock to acquire
Previous Message Amit Kapila 2014-02-22 06:23:24 Re: Patch: show relation and tuple infos of a lock to acquire