Re: Latest version of Hot Standby patch
Simon Riggs <simon@2ndquadrant.com>
From: Simon Riggs <simon@2ndQuadrant.com>
To: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2009-01-08T12:38:02Z
Lists: pgsql-hackers
On Thu, 2009-01-08 at 12:12 +0200, Heikki Linnakangas wrote: > >> Sounds good to me then. Will rework. > > > > Applies brakes suddenly. > > > > I realise this is subtle trap I almost fell into the first time I coded > > it. The function is retrieving GetRunningTransactionData() and so we are > > interested in the latest running xid, not the latest completed xid. The > > latter is sufficient for snapshots, but the information derived by > > GetRunningTransactionData() is used to maintain UnobservedXids. > > If there's no transactions running, latest completed xid is just what we > need. > When there is any transactions in procarray, we should take the > max xid of those, as the patch already does. OK, I don't now see the need for the special case in the way I've done it. There could still be problems there, but if there are they should apply to all cases not just the no transactions running case. -- Simon Riggs www.2ndQuadrant.com PostgreSQL Training, Services and Support