Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W3uuH-00045E-EZ for pgsql-bugs@arkaria.postgresql.org; Thu, 16 Jan 2014 21:55:21 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1W3uuG-0005Vj-Pp for pgsql-bugs@arkaria.postgresql.org; Thu, 16 Jan 2014 21:55:20 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W3uuF-0005Vc-Qe for pgsql-bugs@postgresql.org; Thu, 16 Jan 2014 21:55:19 +0000 Received: from moutng.kundenserver.de ([212.227.17.10]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W3uu8-0006Cz-Nt for pgsql-bugs@postgresql.org; Thu, 16 Jan 2014 21:55:19 +0000 Received: from anarazel.de (p5DDC7505.dip0.t-ipconnect.de [93.220.117.5]) by mrelayeu.kundenserver.de (node=mrbap3) with ESMTP (Nemesis) id 0MS2e2-1VtRaP1Rvu-00TVAd; Thu, 16 Jan 2014 22:55:11 +0100 Received: by anarazel.de (Postfix, from userid 1000) id B7619100827; Thu, 16 Jan 2014 22:55:10 +0100 (CET) Date: Thu, 16 Jan 2014 22:55:10 +0100 From: Andres Freund To: Heikki Linnakangas Cc: Amit Kapila , PostgreSQL Bugs Subject: Re: hot_standby_feedback doesn't work on busy servers in 9.3+ Message-ID: <20140116215510.GG30206@awork2.anarazel.de> References: <20140115130150.GB8653@awork2.anarazel.de> <20140116084427.GG8653@awork2.anarazel.de> <52D84DFD.3040503@vmware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52D84DFD.3040503@vmware.com> X-Provags-ID: V02:K0:1yuS/N6UNH/lyDmphQRCTDq/wz9P9sV9fLBjCp2GJRz g+JiZ8Bx1kr8fQ5lGEWnRipwst+1AqO7JZmYYpkxY4M7THPZjb jP5bCwNj7zNZ41K5WGk8zP8OWqlL/uQRwDQ5/mfcLzP9PxrdLq ZW5fkYYLEYvaupeHT+XIcRt/vWUx9TXolDgRGmS9H4q5G6qiIW SLWjWMLfpPmqQWkO8XoUgsdT9rwujsz4mjzaaFbcbZV4ZfmG/F qtBAYt58FUw2w3EgJDZgs6Lg9OS0BOe2lg5muFXvJ4D++BrhQI yWkP3tXEWF8q1kdlzbfWzV2mK246kuANUVJemm1Fz1ghoI7eSn 1xGOB+42oPOAcR3BrXNw0Ed9h/rU/1SAExWm6A96N 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 On 2014-01-16 23:24:13 +0200, Heikki Linnakangas wrote: > On 01/16/2014 10:44 AM, Andres Freund wrote: > >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. > > The reply message contains a pointers for how far the WAL has been applied, > written, and flushed. There can be a significant delay between the write and > flush steps, so we send a separate reply after writing, and after flushing. > (if we didn't, the flush and write pointers sent to the master would always > be the equal). If we'd always send a message, I'd be convinced by that argument, but we're only sending messages after a timeout. This means that if syncrep is on, we will more frequently have explicitly ask the receiver to send a confirmation since the reply before the flush will have reset the timers causing the reply after the flush to only infrequently send something. 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