Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 60C3164FE47 for ; Mon, 17 Nov 2008 09:51:39 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 55410-08 for ; Mon, 17 Nov 2008 09:51:36 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.173]) by mail.postgresql.org (Postfix) with ESMTP id D5CA464FDFD for ; Mon, 17 Nov 2008 09:51:35 -0400 (AST) Received: by ug-out-1314.google.com with SMTP id k40so406345ugc.7 for ; Mon, 17 Nov 2008 05:51:34 -0800 (PST) Received: by 10.66.224.19 with SMTP id w19mr1279448ugg.71.1226929893905; Mon, 17 Nov 2008 05:51:33 -0800 (PST) Received: from ?80.222.79.63? (dsl-hkibrasgw2-fe4fde00-63.dhcp.inet.fi [80.222.79.63]) by mx.google.com with ESMTPS id o30sm4152438ugd.52.2008.11.17.05.51.31 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 17 Nov 2008 05:51:32 -0800 (PST) Message-ID: <492176E2.1000006@enterprisedb.com> Date: Mon, 17 Nov 2008 15:51:30 +0200 Organization: EnterpriseDB User-Agent: Mozilla-Thunderbird 2.0.0.16 (X11/20080724) MIME-Version: 1.0 To: Simon Riggs CC: pgsql-hackers Subject: Re: [PATCHES] Infrastructure changes for recovery (v8) References: <1222815151.4445.1397.camel@ebony.2ndQuadrant> <48EC9CC5.6060803@enterprisedb.com> <1223468660.4747.294.camel@ebony.2ndQuadrant> <1223472898.4747.310.camel@ebony.2ndQuadrant> In-Reply-To: <1223472898.4747.310.camel@ebony.2ndQuadrant> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit From: Heikki Linnakangas X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200811/1141 X-Sequence-Number: 127853 Simon Riggs wrote: > diff --git a/src/backend/access/transam/subtrans.c b/src/backend/access/transam/ > index 063b366..5e64cb4 100644 > --- a/src/backend/access/transam/subtrans.c > +++ b/src/backend/access/transam/subtrans.c > @@ -226,6 +226,9 @@ ZeroSUBTRANSPage(int pageno) > * > * oldestActiveXID is the oldest XID of any prepared transaction, or nextXid > * if there are none. > + * > + * Note that this is not atomic and is not yet safe to perform while other > + * processes might access subtrans. > */ > void > StartupSUBTRANS(TransactionId oldestActiveXID) I'm a bit confused by that comment. Does that need to be fixed? It sounds like it does, because other processes might access subtrans when StartupSUBTRANS is called, with the patch to allow read-only queries during recovery. Or is that done in the hot standby patch? However, I don't see why that isn't safe. StartupSUBTRANS takes the SubtransControlLock in exclusive mode while it zeroes out subtrans. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com