Re: Sending notifications from the master to the standby - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Sending notifications from the master to the standby
Date
Msg-id 25200.1326214550@sss.pgh.pa.us
Whole thread Raw
In response to Re: Sending notifications from the master to the standby  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: Sending notifications from the master to the standby  (Simon Riggs <simon@2ndQuadrant.com>)
Re: Sending notifications from the master to the standby  (Joachim Wieland <joe@mcknight.de>)
List pgsql-hackers
Simon Riggs <simon@2ndQuadrant.com> writes:
> On Tue, Jan 10, 2012 at 5:00 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> It might be a bit tricky to get walreceivers to inject
>> the data into the slave-side ring buffer at the right time, ie, not
>> until after the commit a given message describes has been replayed;
>> but I don't immediately see a reason to think that's infeasible.

> [ Simon sketches a design for that ]

Seems a bit overcomplicated.  I was just thinking of having walreceiver
note the WAL endpoint at the instant of receipt of a notify message,
and not release the notify message to the slave ring buffer until WAL
replay has advanced that far.  You'd need to lay down ground rules about
how the walsender times the insertion of notify messages relative to
WAL in its output.  But I don't see the need for either explicit markers
in the WAL stream or a hash table.  Indeed, a hash table scares me
because it doesn't clearly guarantee that notifies will be released in
arrival order.

> Suggest we add something to initial handshake from standby to say
> "please send me notify traffic",

+1 on that.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Sending notifications from the master to the standby
Next
From: Peter Eisentraut
Date:
Subject: Re: libpq: PQcmdStatus, PQcmdTuples signatures can be painlessly improved