Thread: rserv replication error
I'm doing a little testing of rserv here. Does anyone recognize the issue with this error? $ InitRservTest $ psql -d master -c "update test set k = k + 1000" UPDATE 100 $ psql -d master -c "update test set k = k - 1000" UPDATE 100 $ psql -d master -c "update test set k = k + 1000" ERROR: _rserv_log_: duplicate tuples Thanks, Ed
On Tue, Feb 25, 2003 at 04:36:56PM -0700, Ed L. wrote: > I'm doing a little testing of rserv here. Does anyone recognize the > issue with this error? > > $ InitRservTest > $ psql -d master -c "update test set k = k + 1000" > UPDATE 100 > $ psql -d master -c "update test set k = k - 1000" > UPDATE 100 > $ psql -d master -c "update test set k = k + 1000" > ERROR: _rserv_log_: duplicate tuples I _think you've tripped over the (in)ability of contrib/rserv to keep up with large numbers of changes to the same tuple inside the snapshot period. I think there may have been a patch to the rserv.c code which fixed this at one time, but I don't know. If you run the snapshot-applier often enough, you probably won't run into this; but there's no guarantee. It was one of the reasons the contrib/ code wasn't enough for us back when we started up with .info, and why we collaborated with PostgreSQL, Inc. to improve the code. This is fixed in the PostgreSQL, Inc. version, but that doesn't help you if you want free software right now. I gather that dbmirror might be a little better at this, but I don't know. Others have said that they've had good luck with it (I have something that works for me now, so I'm not about to change it!). One thing I do notice about dbmirror is that it requires a single-column primary key on every replicated table. I bet you could hack it to use some other not null unique column, though. A -- ---- Andrew Sullivan 204-4141 Yonge Street Liberty RMS Toronto, Ontario Canada <andrew@libertyrms.info> M2P 2A8 +1 416 646 3304 x110
> One thing I do notice about dbmirror is that it requires a > single-column primary key on every replicated table. I bet you could > hack it to use some other not null unique column, though. Are you sure about that? We're using it right now on several tables with multi-column primary keys with no problems. There used to be a problem with tables that had _no_ primary key, but the developer (Steve Singer IIRC) fixed that, at least in so far as it no longer crashes. I don't know if it actually replicates those tables since I got primary keys added to all our *ahem* unnormalized tables. Greg
Le Mercredi 26 Février 2003 19:42, Gregory Wood a écrit : > > One thing I do notice about dbmirror is that it requires a > > single-column primary key on every replicated table. I bet you could > > hack it to use some other not null unique column, though. > > Are you sure about that? We're using it right now on several tables with > multi-column primary keys with no problems. > > There used to be a problem with tables that had _no_ primary key, but the > developer (Steve Singer IIRC) fixed that, at least in so far as it no > longer crashes. I don't know if it actually replicates those tables since I > got primary keys added to all our *ahem* unnormalized tables. Same for me here ... Using DBmirror since 3 months ... and no primary key on all my table ! Regards, -- Hervé Piedvache Elma Ingénierie Informatique 6 rue du Faubourg Saint-Honoré F-75008 - Paris - France Tel. 33-144949901 fax. 33-144949902
I said > > One thing I do notice about dbmirror is that it requires a > > single-column primary key on every replicated table. On Wed, Feb 26, 2003 at 01:42:00PM -0500, Gregory Wood wrote: > Are you sure about that? We're using it right now on several tables with > multi-column primary keys with no problems. No, I'm not. I think it used to be true, anyway, but as I said, I don't use it. > There used to be a problem with tables that had _no_ primary key, but the > developer (Steve Singer IIRC) fixed that, at least in so far as it no longer > crashes. I don't know if it actually replicates those tables since I got The README still says you need a primary key, but nothing about single column any more. A -- ---- Andrew Sullivan 204-4141 Yonge Street Liberty RMS Toronto, Ontario Canada <andrew@libertyrms.info> M2P 2A8 +1 416 646 3304 x110