pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Simon Riggs <simon@2ndQuadrant.com>
To: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: Hot Standby on git
Date: Thu, 01 Oct 2009 15:39:27 +0100
Message-ID: <1254407967.17864.229.camel@ebony.2ndQuadrant> (raw)
In-Reply-To: <4AC49281.2040302@enterprisedb.com>
References: <1253958559.4449.833.camel@ebony.2ndQuadrant>
	<4AC49281.2040302@enterprisedb.com>


On Thu, 2009-10-01 at 14:29 +0300, Heikki Linnakangas wrote:
> +   /*
> +    * 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.

Hmm, yes. ISTM that I'm still calculating latestRunningXid the old way
while assuming it is calculated the new way. The new way is just to grab
nextXid since we have XidGenLock and do TransactionIdRetreat() on it.

-- 
 Simon Riggs           www.2ndQuadrant.com




view thread (48+ messages)  latest in thread

Message-ID: <1254407967.17864.229.camel@ebony.2ndQuadrant>
Permalink:  ../1254407967.17864.229.camel@ebony.2ndQuadrant/
Also on:    postgresql.org/message-id/1254407967.17864.229.camel@ebony.2ndQuadrant

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: simon@2ndQuadrant.com, heikki.linnakangas@enterprisedb.com
  Subject: Re: Hot Standby on git
  In-Reply-To: <1254407967.17864.229.camel@ebony.2ndQuadrant>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox