Re: RServ patch to support multiple slaves (sorta)

From: Michael A Nachbaur <mike(at)nachbaur(dot)com>
To: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: RServ patch to support multiple slaves (sorta)
Date: 2003-06-25 20:36:52
Message-ID: 200306251336.52670.mike@nachbaur.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wednesday 25 June 2003 08:42 am, Alvaro Herrera wrote:
> On Wed, Jun 25, 2003 at 11:11:35AM -0400, Bruce Momjian wrote:
> > Tom Lane wrote:
> > > Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > > > Patch applied. Thanks.
> > > >
> > > > Michael A Nachbaur wrote:
> > > >> Attached is a patch that provides *VERY* limited support for
> > > >> multiple slave servers. I haven't tested it very well, so use at
> > > >> your own risk (and I recommend against using it in production).
> > >
> > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > >
> > > It sounded to me like that patch was intended for comment, not for
> > > application.

Yes, this was my original intent. If anyone else thought it was worthy enough
to go into CVS, then great, but mainly I wanted a few more pairs of eyes to
look it over.

> > He said it wasn't all he wanted to do with the code, but that it did
> > work. With so few rserv patches, it seems like something we should get
> > in, but maybe not? Other comments? I am not sure myself.
>
> I don't remember the patch right now, but it seemed to me the patch
> didn't have anything to do with multiple slaves anyway... When was it
> posted? I can't find it in the archives... (it'd be nice to have the
> date of the original message in the attribution when you quote other
> people, that way it's much easier to find it in the archives)

All my patch does is allow you to limit what tables you replicate from a
slave. In this way, SlaveA can replicate tables X, Y and Z, while SlaveB can
replicate tables M, N and O.

I have a single master database, and different authentication databases at key
areas of my infrastructure (mail authentication, web server configuration,
etc). I was getting errors when trying to replicate SlaveA just after adding
SlaveB, because the necessary tables didn't exist on SlaveA.

> Some 2 years ago I wrote a patch for multiple slaves and it worked
> reasonably well... I wasn't too much in the Postgres world those days so
> I didn't submit it. If I can get to my CVS archive I'll extract it and
> post for review.

That'd be great. My patch, like I said in my original post (06/19/2003
07:36pm PST), is just a beginning, and I'm not even 100% sure it'll work
reliably. Although I'm an experienced Perl programmer, I'm not as familar
with PostgreSQL's internals as I'd like to be (e.g. I tread lightly when it
comes to the pg_* tables).

If someone else has better support, I'd much rather a) take the code and run,
and b) not have to do the same myself since I have too many items on my task
list as it is.

--
Michael A Nachbaur <mike(at)nachbaur(dot)com>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-06-25 20:38:05 Re: Feature freeze and the great elog changeover
Previous Message Kevin Brown 2003-06-25 20:36:40 Re: Two weeks to feature freeze