Re: HOOKS for Synchronous Replication? - Mailing list pgsql-hackers

From Jonah H. Harris
Subject Re: HOOKS for Synchronous Replication?
Date
Msg-id 36e682920512081219v21014408ma1d70b0e187975c0@mail.gmail.com
Whole thread Raw
In response to Re: HOOKS for Synchronous Replication?  (Jan Wieck <JanWieck@Yahoo.com>)
List pgsql-hackers
True, I think we need hooks for both methods.

On 12/8/05, Jan Wieck <JanWieck@yahoo.com> wrote:
On 12/8/2005 2:05 PM, Jim C. Nasby wrote:

> On Thu, Dec 08, 2005 at 08:33:59AM -0800, Darcy Buskermolen wrote:
>> On Wednesday 07 December 2005 20:24, Tom Lane wrote:
>> > Christopher Kings-Lynne < chriskl@familyhealth.com.au> writes:
>> > > Anyone remember this patch?
>> > > http://gorda.di.uminho.pt/community/pgsqlhooks/
>> > > The discussion seems to be pretty minimal:
>> > > http://archives.postgresql.org/pgsql-hackers/2005-06/msg00859.php
>> > > Does anyone see a need to investigate it further?
>> >
>> > I had hoped to see some comments from the Slony people about it.
>> > I'd feel better about the validity of a set of hooks if more than
>> > one project agreed that it was useful/appropriate ...
>>
>> I missed seeing it all together the first time through, I'll see what I can do
>> about taking a indepth look at it over the next few days and provide some
>> feedback.
>
> While this code might be useful, whouldn't it be much more valuable to
> provide hooks into xlog so that we could do non-trigger-based
> replication? (As well as non-trigger-based materialized views...)

I don't see why these would be mutually exclusive. A generic API needs
to have them all.

Without having looked at the patch yet, what I expect from an API is
that the backend will (after initialization and becoming a member of a
database) check if this database is replicated. If so load the specific
shared object that implement the backend part of the replication system
and then call an init() function in that. This init() function then will
add callbacks to all the hooks where this particular replication system
wants to be called. So one replication system might want to be called on
commit, just before writing the WAL record, some other system doesn't
care about that, but wants to see the WAL record after it was written.


Jan

--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Reducing relation locking overhead
Next
From: Ron Mayer
Date:
Subject: Re: Concurrent CREATE INDEX, try 2 (was Re: Reducing relation locking