Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 43DB5633547 for ; Fri, 2 Oct 2009 04:32:46 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 19554-06 for ; Fri, 2 Oct 2009 07:32:38 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from outmail128092.authsmtp.net (outmail128092.authsmtp.net [62.13.128.92]) by mail.postgresql.org (Postfix) with ESMTP id 33378633627 for ; Fri, 2 Oct 2009 04:32:36 -0300 (ADT) Received: from mail-c193.authsmtp.com (mail-c193.authsmtp.com [62.13.128.118]) by punt8.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id n927WVYv096226; Fri, 2 Oct 2009 08:32:31 +0100 (BST) Received: from [192.168.0.5] (88-110-190-77.dynamic.dsl.as9105.com [88.110.190.77]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id n927WTGp019421; Fri, 2 Oct 2009 08:32:29 +0100 (BST) Subject: Re: Hot Standby on git From: Simon Riggs To: Heikki Linnakangas Cc: pgsql-hackers In-Reply-To: <4AC5A60F.5050503@enterprisedb.com> References: <1253958559.4449.833.camel@ebony.2ndQuadrant> <4AC2FBB9.7060304@enterprisedb.com> <1254408330.17864.233.camel@ebony.2ndQuadrant> <4AC4CF18.50309@enterprisedb.com> <1254413624.17864.243.camel@ebony.2ndQuadrant> <4AC5A60F.5050503@enterprisedb.com> Content-Type: text/plain Date: Fri, 02 Oct 2009 08:36:06 +0100 Message-Id: <1254468966.17864.301.camel@ebony.2ndQuadrant> Mime-Version: 1.0 X-Mailer: Evolution 2.12.0 Content-Transfer-Encoding: 7bit X-Server-Quench: bd993ea3-af25-11de-90cd-002264978518 X-Report-Spam: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-AuthRoute: OCdxZQATClZOTQEd DAteCiN5VAwpPBRK HVkIKg5MJUcNSQVJ NksadBtFaAdbYlpF HGQLW11EUFV7WmF/ aQMfZQ1DY0tOQQRj UFZORU1QEQdtHhxP WBccVX4WAEVGeXd0 Z0csWndZXgooIU90 QRsFFnBXM2VldWEe BBVFfgMHJB5Kfh1H bFR2U3sIYG1JBC9q VzwTFhsSEA9kHWx1 RR1FFk4bR0oBD3Y7 QVgNHClH X-Authentic-SMTP: 61633235383639.1014:706/Kp X-Virus-Status: No virus detected - but ensure you scan with your own anti-virus system. X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200910/139 X-Sequence-Number: 146951 On Fri, 2009-10-02 at 10:04 +0300, Heikki Linnakangas wrote: > Simon Riggs wrote: > > @@ -7061,6 +7061,15 @@ ShutdownXLOG(int code, Datum arg) > > else > > { > > /* > > + * Take a snapshot of running transactions and write this to WAL. > > + * This allows us to reconstruct the state of running transactions > > + * during archive recovery, if required. We do this even if we are > > + * not archiving, to allow a cold physical backup of the server to > > + * be useful as a read only standby. > > + */ > > + GetRunningTransactionData(); > > + > > + /* > > * If archiving is enabled, rotate the last XLOG file so that all the > > * remaining records are archived (postmaster wakes up the archiver > > * process one more time at the end of shutdown). The checkpoint > > > > I don't think this will do any good where it's placed. The checkpoint > that follows will have its redo-pointer beyond the running-xacts record, > so WAL replay will never see it. Perhaps we need two entries then to cover multiple use cases? The placement of this was specifically chosen so that it is the last entry before the log switch, so that the runningxact record would be archived. Yes, we also need one after the shutdown checkpoint to cover the case where the whole data directory is copied after shutdown. The comments matched the latter case but the position addressed the first case, so it looks like I was confused as to which case I was addressing. Have updated code to do both. See what you think. Thanks. -- Simon Riggs www.2ndQuadrant.com