Re: hot_standby_feedback doesn't work on busy servers in 9.3+

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: PostgreSQL Bugs <pgsql-bugs(at)postgresql(dot)org>, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
Subject: Re: hot_standby_feedback doesn't work on busy servers in 9.3+
Date: 2014-01-16 08:44:27
Message-ID: 20140116084427.GG8653@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

On 2014-01-16 10:26:51 +0530, Amit Kapila wrote:
> > Looking into this I also noticed that the busy path is odd, because a)
> > why are we sending a reply before flushing things to disk? b)
> > XLogWalRcvFlush() will do it's own XLogWalRcvSendReply().
>
> I think call to reply in XLogWalRcvFlush() might not actually send
> reply because of time difference of last Reply message which we
> sent before flush call.

Yes, but most of the time that will lead to only outdated data to be
sent since that's the first call. Hardly a severe issue, odd nonetheless.

> The only point that occurs to me for having such a code is that
> incase flush call fails due to disk space or some other such issue,
> it can atleast send the correct write position to primary.

Unconvinced.

That's really a separate issue though.

> > To a good part that seems to have been introduced in
> > 6f60fdd7015b032bf49273c99f80913d57eac284.
>
> I don't see that above commit has introduced this behaviour, as
> the code in question seems to be there without commit as well,
> means that HS feedback is only sent when we don't receive data in WAL
> receiver.

Part of that commit is the following hunk:

@@ -609,19 +665,25 @@ XLogWalRcvFlush(bool dying)

/* Also let the master know that we made some progress */
if (!dying)
- {
- XLogWalRcvSendReply();
- XLogWalRcvSendHSFeedback();
- }
+ XLogWalRcvSendReply(false, false);
}
}

Before that commit XLogWalRcvFlush, which is in the "busy" path, sent
hot standby feedback. After that only the idle path does so.

Greetings,

Andres Freund

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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Amit Kapila 2014-01-16 10:34:18 Re: hot_standby_feedback doesn't work on busy servers in 9.3+
Previous Message Amit Kapila 2014-01-16 04:56:51 Re: hot_standby_feedback doesn't work on busy servers in 9.3+