Re: Hot Standby: too many KnownAssignedXids

Simon Riggs <simon@2ndquadrant.com>

From: Simon Riggs <simon@2ndQuadrant.com>
To: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Cc: Joachim Wieland <joe@mcknight.de>, Fujii Masao <masao.fujii@gmail.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2010-11-24T15:19:47Z
Lists: pgsql-hackers
On Wed, 2010-11-24 at 12:48 +0200, Heikki Linnakangas wrote:
> When recovery starts, we fetch the oldestActiveXid from the checkpoint
> record. Let's say that it's 100. We then start replaying WAL records 
> from the Redo pointer, and the first record (heap insert in your case)
> contains an Xid that's much larger than 100, say 10000. We call 
> RecordKnownAssignedXids() to make note that all xids between that
> range are in-progress, but there isn't enough room in the array for
> that.

Agreed.

> Hmm. I'm not sure off the top of my head how to fix that. Perhaps
stash 
> the xids we see during WAL replay in private memory instead of
> putting 
> them in the KnownAssignedXids array until we see the running-xacts
> record.

Moving LogStandbySnapshot() earlier will help but won't solve it fully.

Will think.

-- 
 Simon Riggs           http://www.2ndQuadrant.com/books/
 PostgreSQL Development, 24x7 Support, Training and Services