Re: Cascade replication

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Cascade replication
Date: 2011-07-19 11:19:40
Message-ID: CAHGQGwEH1iz4m5B8ievOZUzxt1WBbhn8n49fom3Ktz66asoM7g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jul 19, 2011 at 5:58 PM, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
> On Mon, Jul 11, 2011 at 7:28 AM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
>
>> Attached is the updated version which addresses all the issues raised by
>> Simon.
>
> Is there any reason why we disallow cascading unless hot standby is enabled?
>
> ISTM we can just alter the postmaster path for walsenders, patch attached.
>
> Some people might be happier if a sync standby were not HS enabled,
> yet able to cascade to other standbys for reading.

- return CAC_STARTUP; /* normal startup */
+ {
+ if (am_walsender)
+ return CAC_OK;
+ else
+ return CAC_STARTUP; /* normal startup */
+ }

In canAcceptConnections(), am_walsender is always false, so the above CAC_OK
is never returned. You should change ProcessStartupPacket() as follows, instead.

switch (port->canAcceptConnections)
{
case CAC_STARTUP:
+ if (am_walsender)
+ {
+ port->canAcceptConnections = CAC_OK;
+ break;
+ }
ereport(FATAL,

When I fixed the above, compile the code and set up the cascading replication
environment (disable hot_standby), I got the following assertion error:

TRAP: FailedAssertion("!(slot > 0 && slot <=
PMSignalState->num_child_flags)", File: "pmsignal.c", Line: 227)

So we would still have some code to change.

Regards,

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mike Toews 2011-07-19 11:23:24 Function argument names in pg_catalog
Previous Message Yeb Havinga 2011-07-19 10:15:12 Re: [v9.1] sepgsql - userspace access vector cache