On Thu, 2008-09-11 at 17:58 +0300, Heikki Linnakangas wrote:
> BTW, we haven't talked about how to acquire a snapshot in the slave.
> You'll somehow need to know which transactions have not yet committed,
> but will in the future. In the master, we keep track of in-progress
> transaction in the ProcArray, so I suppose we'll need to do the same
> in the slave. Very similar to prepared transactions, actually. I
> believe the Abort records, which are not actually needed for normal
> operation, become critical here. The slave will need to put an entry
> to ProcArray for any new XLogRecord.xl_xid it sees in the WAL, and
> remove the entry at a Commit and Abort record. And clear them all at a
> shutdown record.
Although I said differently earlier, it seems cleaner to make recovery
snapshots work by emulating ProcArray entries as you suggest. Fatal
errors were my problem there, but I think that's solvable now.
-- Simon Riggs www.2ndQuadrant.comPostgreSQL Training, Services and Support