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

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Andres Freund <andres(at)2ndquadrant(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 10:34:18
Message-ID: CAA4eK1LtJa1KYk1kVq8uFyoLbZuVVL5E2ttox1kAEgBHYiG3vQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, Jan 16, 2014 at 2:14 PM, Andres Freund <andres(at)2ndquadrant(dot)com> wrote:
> On 2014-01-16 10:26:51 +0530, Amit Kapila wrote:
>
>> > 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.

Okay, Thanks for pointing out.
This is clearly a problem and I think that part of patch should be reverted.
I have figured out how this has happened, actually during the patch
(Improve replication connection timeouts) development, there was an idea
to merge Reply and Feedback messages during which this call got removed
but later on that doesn't appear to be good way of proceeding, so we decide
not merge the messages. While kicking out merge of messages part, it seems
to me that we forgot to add this back.

Heikki, do you remember any other reason for this problem?
I had referred below thread and the mails following it to find this out:
http://www.postgresql.org/message-id/6C0B27F7206C9E4CA54AE035729E9C382853645A@szxeml509-mbs

Attached patch should fix this problem.

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

Attachment Content-Type Size
bug_fix_missing_hs_feedback_message.patch application/octet-stream 433 bytes

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Heikki Linnakangas 2014-01-16 21:14:17 Re: hot_standby_feedback doesn't work on busy servers in 9.3+
Previous Message Andres Freund 2014-01-16 08:44:27 Re: hot_standby_feedback doesn't work on busy servers in 9.3+