On 19 June 2012 14:03, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> "Every WAL record"? Why in heck would you attach it to every record?
> Surely putting it in WAL page headers would be sufficient. We could
> easily afford to burn a page switch (if not a whole segment switch)
> when changing masters.
This does appear to be a reasonable idea at first glance, since it
seems that each node has just a single node id, but that is not the
case.
As we pass changes around we maintain the same origin id for a change,
so there is a mix of origin node ids at the WAL record level, not the
page level. The concept of originating node id is essentially same as
that used in Slony.
> I'm against the idea of eating any spare space we have in WAL record
> headers for this purpose, anyway; there are likely to be more pressing
> needs in future.
Not sure what those pressing needs are, but I can't see any. What we
are doing here is fairly important, just not as important as crash
recovery. But then that has worked pretty much unchanged for some time
now.
I raised the possibility of having variable length headers, but there
is no requirement for that yet.
--
Simon Riggs http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services