Re: Cascade replication

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Cascade replication
Date: 2011-07-05 03:34:58
Message-ID: CAHGQGwFnY1FWvUz-b83MucyKF-t+syNZA_qHB4nRtHtoHtWong@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jul 4, 2011 at 6:24 PM, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
> On Tue, Jun 14, 2011 at 6:08 AM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
>
>>> The standby must not accept replication connection from that standby itself.
>>> Otherwise, since any new WAL data would not appear in that standby,
>>> replication cannot advance any more. As a safeguard against this, I introduced
>>> new ID to identify each instance. The walsender sends that ID as the fourth
>>> field of the reply of IDENTIFY_SYSTEM, and then walreceiver checks whether
>>> the IDs are the same between two servers. If they are the same, which means
>>> that the standby is just connecting to that standby itself, so walreceiver
>>> emits ERROR.
>
> Thanks for waiting for review.

Thanks for the review!

> This part of the patch is troubling me. I think you have identified an
> important problem, but this solution doesn't work fully.
>
> If we allow standbys to connect to other standbys then we have
> problems with standbys not being connected to master. This can occur
> with a 1-step connection, as you point out, but it could also occur
> with a 2-step, 3-step or more connection, where a circle of standbys
> are all depending upon each other. Your solution only works for 1-step
> connections. "Solving" that problem in a general sense might be more
> dangerous than leaving it alone. I think we should think some more
> about the issues there and approach them as a separate problem.
>
> I think we should remove that and just focus on the main problem, for
> now. That will make it a simpler patch and easier to commit.

I agree to focus on the main problem first. I removed that. Attached
is the updated version.

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

Attachment Content-Type Size
cascade_replication_v2.patch text/x-patch 32.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2011-07-05 05:54:18 Re: Online base backup from the hot-standby
Previous Message Fujii Masao 2011-07-05 02:59:43 Re: Latch implementation that wakes on postmaster death on both win32 and Unix