Re: Synchronous Log Shipping Replication

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Csaba Nagy <nagy(at)ecircle-ag(dot)com>
Cc: Hannu Krosing <hannu(at)2ndQuadrant(dot)com>, Simon Riggs <simon(at)2ndQuadrant(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Bruce Momjian <bruce(at)momjian(dot)us>, Markus Wanner <markus(at)bluegap(dot)ch>, ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Synchronous Log Shipping Replication
Date: 2008-09-12 16:25:14
Message-ID: 48CA97EA.5090104@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Csaba Nagy wrote:
> Why not have a design where the slave is in control for it's own data ?
> I mean the slave could ask for the base files (possibly through a
> special function deployed on the master), then ask for the WAL stream
> and so on. That would easily let a slave cascade too, as it could relay
> the WAL stream and serve the base backup too... or have a special WAL
> repository software with the same interface as a normal master, but
> having a choice of base backups and WAL streams. Plus that a slave in
> control approach would also allow multiple slaves at the same time for a
> given master...

I totally agree with that.

> The only downside of this approach is that the slave machine needs a
> full postgres super user connection to the master. That could be a
> security problem in certain scenarios.

I think the master-slave protocol needs to be separate from the normal
FE/BE protocol, with commands like "send a new base backup", or
"subscribe to new WAL that's generated". A master-slave connection isn't
associated with any individual database, for example. We can keep the
permissions required for establishing a master-slave connection
different from super-userness. In particular, while the slave will be
able to read all data from the whole cluster, by receiving it in the WAL
and base backups, it doesn't need to be able to modify anything in the
master.

> The master-centric scenario needs
> a connection in the other direction, which might be seen as more secure,
> I don't know for sure...

Which one initiates the connection, the master or slave, is a different
question. I believe we've all assumed that it's the slave that connects
to the master, and I think that makes the most sense.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Markus Wanner 2008-09-12 16:25:54 Re: Synchronous Log Shipping Replication
Previous Message Andrew Dunstan 2008-09-12 16:01:37 Re: Synchronous Log Shipping Replication