Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 2C1E063280F for ; Thu, 1 Oct 2009 08:29:21 -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 66832-05 for ; Thu, 1 Oct 2009 11:29:13 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from exprod7og126.obsmtp.com (exprod7og126.obsmtp.com [64.18.2.206]) by mail.postgresql.org (Postfix) with SMTP id 940DE632680 for ; Thu, 1 Oct 2009 08:29:12 -0300 (ADT) Received: from source ([209.85.219.215]) by exprod7ob126.postini.com ([64.18.6.12]) with SMTP ID DSNKSsSShnN++C1C/KtUhgNBBr4+e9yqGuNA@postini.com; Thu, 01 Oct 2009 04:29:12 PDT Received: by ewy11 with SMTP id 11so40867ewy.35 for ; Thu, 01 Oct 2009 04:29:09 -0700 (PDT) Received: by 10.211.132.33 with SMTP id j33mr3948038ebn.20.1254396549583; Thu, 01 Oct 2009 04:29:09 -0700 (PDT) Received: from ?192.168.1.117? ([88.195.103.165]) by mx.google.com with ESMTPS id 5sm2243296eyh.24.2009.10.01.04.29.07 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 01 Oct 2009 04:29:08 -0700 (PDT) Message-ID: <4AC49281.2040302@enterprisedb.com> Date: Thu, 01 Oct 2009 14:29:05 +0300 From: Heikki Linnakangas Organization: EnterpriseDB User-Agent: Mozilla-Thunderbird 2.0.0.19 (X11/20090103) MIME-Version: 1.0 To: Simon Riggs CC: pgsql-hackers Subject: Re: Hot Standby on git References: <1253958559.4449.833.camel@ebony.2ndQuadrant> In-Reply-To: <1253958559.4449.833.camel@ebony.2ndQuadrant> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-6.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599, RCVD_IN_DNSWL_MED=-4 X-Spam-Level: X-Archive-Number: 200910/21 X-Sequence-Number: 146833 + /* + * If our initial RunningXactData had an overflowed snapshot then we + * knew we were missing some subxids from our snapshot. We can use + * this data as an initial snapshot, but we cannot yet mark it valid. + * We know that the missing subxids are equal to or earlier than + * LatestRunningXid. After we initialise we continue to apply changes + * during recovery, so once the oldestRunningXid is later than the + * initLatestRunningXid we can now prove that we no longer have + * missing information and can mark the snapshot as valid. + */ + if (initRunningXactData && !recoverySnapshotValid) + { + if (TransactionIdPrecedes(initLatestRunningXid, xlrec->oldestRunningXid) + { + recoverySnapshotValid = true; + elog(trace_recovery(DEBUG2), + "running xact data now proven complete"); + elog(trace_recovery(DEBUG2), + "recovery snapshots are now enabled"); + } + return; + } + When GetRunningXactData() calculates latestRunningXid in the master, which is stored in initLatestRunningXid in the standby, it only looks at xids and subxids present in the procarray. It doesn't take into account overflowed subxids. I think we could declare a recovery snapshot "proven complete" too early because of that. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com