Re: [PATCH 10/16] Introduce the concept that wal has a 'origin' node

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Daniel Farina <daniel(at)heroku(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>
Subject: Re: [PATCH 10/16] Introduce the concept that wal has a 'origin' node
Date: 2012-06-19 07:22:59
Message-ID: 201206190922.59560.andres@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Tuesday, June 19, 2012 08:03:04 AM Tom Lane wrote:
> Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> > On Monday, June 18, 2012 11:51:27 PM Daniel Farina wrote:
> >> What's the cost of going a lot higher? Because if one makes enough
> >> numerical space available, one can assign node identities without a
> >> coordinator, a massive decrease in complexity.
> >
> > It would increase the size of every wal record. We just have 16bit left
> > there by chance...
>
> "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.
The idea is that you can have cascading, circular and whatever replication
topologies if you include the "logical origin" of a wal causing action into
it.
That is, if you have nodes A(1) and B(2) and a insert happens on A the wal
records generated by that will get an xl_origin_id = 1 and when it will be
decoded and replayed on B it will *also* get the id 1. Only when a change
originally is generated on Bit will get xl_origin_id = 2.
That way you can easily have circular or hierarchical replication topologies
including diamonds.

> 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.
Every other solution to allowing this seems to be far more complicated than
this, thats why I arrived at the conclusion that its a good idea.

Greetings,

Andres
--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2012-06-19 07:24:06 Re: [PATCH 10/16] Introduce the concept that wal has a 'origin' node
Previous Message Peter Eisentraut 2012-06-19 07:16:17 Re: psql tab completion for GRANT role