Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W3iZ0-0005pA-BA for pgsql-bugs@arkaria.postgresql.org; Thu, 16 Jan 2014 08:44:34 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1W3iYz-0002YT-Q4 for pgsql-bugs@arkaria.postgresql.org; Thu, 16 Jan 2014 08:44:33 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W3iYy-0002Wq-7w for pgsql-bugs@postgresql.org; Thu, 16 Jan 2014 08:44:32 +0000 Received: from moutng.kundenserver.de ([212.227.126.187]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W3iYv-0000CW-EO for pgsql-bugs@postgresql.org; Thu, 16 Jan 2014 08:44:31 +0000 Received: from anarazel.de (p5DDC7505.dip0.t-ipconnect.de [93.220.117.5]) by mrelayeu.kundenserver.de (node=mreu3) with ESMTP (Nemesis) id 0M0XGM-1VDOYU0srW-00usEd; Thu, 16 Jan 2014 09:44:28 +0100 Received: by anarazel.de (Postfix, from userid 1000) id 7CC4B101193; Thu, 16 Jan 2014 09:44:27 +0100 (CET) Date: Thu, 16 Jan 2014 09:44:27 +0100 From: Andres Freund To: Amit Kapila Cc: PostgreSQL Bugs , Heikki Linnakangas Subject: Re: hot_standby_feedback doesn't work on busy servers in 9.3+ Message-ID: <20140116084427.GG8653@awork2.anarazel.de> References: <20140115130150.GB8653@awork2.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Provags-ID: V02:K0:KOKQS3ruvxj5M4iydv2VpMwCkB9fivhXWH/3DyXeZCk HGN+1p2v/GhuZjvC5yiqgkYLYL/9a+g0IdbLhg0ObGAvCfB3r8 w1WBe+SX/KlGFgun74gEGtVJL4lwwKlz8O00wcMHkhdBla6GOi uqWuyc46qBKrYOjbtzBxQF2L7VRpNu0qz/SpayoqFvgU8l5tth BhSYXPTheP1tSKwJBIeOmvPgbHgehC2JzWjGXLstTIXwj8Ea1P pOpNMY0hMj9XOIWRhQNulJ+iWMf47Q2JGYieBF0pIRsOH2PpmW gNXt7wWz2+fHIZeFSuVtcH3KhiLxosLlxsotVoeusQyTPgmhtc irMZDizN4FzjalG+B5R3cD1yuuQtlrjCVmbdyCxie X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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 -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs