Re: Latest version of Hot Standby patch

Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>

From: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
To: Simon Riggs <simon@2ndQuadrant.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2009-01-07T13:43:31Z
Lists: pgsql-hackers
Another annoyance I noticed while testing the case of a lot of 
subtransactions (overflowing the procarray cache) is that when you have 
a transaction with a lot of subtransactions open, getting the initial 
snapshot fails, and the standby doesn't open for read-only queries.

Normally, GetRunningTransactionData determines the xid of the latest 
running xid by scanning the procarray. If the subxid cache has 
overflowed, it simply gives up. Comment there suggests that it could 
call ReadNewTransactionId() instead, like it does when there's no active 
xids in proc array. I think we should do that, or something else to 
alleviate the problem.

When there's no xids in the procarray, couldn't we just use 
latestCompletedXid instead of calling ReadNewTransactionId()?

-- 
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com