Re: [PATCH 10/16] Introduce the concept that wal has a 'origin' node - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: [PATCH 10/16] Introduce the concept that wal has a 'origin' node
Date
Msg-id CA+U5nM+p995Uh=PWMyvcvA7ec-Zz1sHv=6f4ebau026i02sOGg@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH 10/16] Introduce the concept that wal has a 'origin' node  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
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


pgsql-hackers by date:

Previous
From: Leon Smith
Date:
Subject: Re: Transactions over pathological TCP connections
Next
From: "Kevin Grittner"
Date:
Subject: Re: use of int4/int32 in C code