Re: [HACKERS] Slony-I goes BETA (possible bug)

From: Chris Browne <cbbrowne(at)acm(dot)org>
To: pgsql-advocacy(at)postgresql(dot)org
Subject: Re: [HACKERS] Slony-I goes BETA (possible bug)
Date: 2004-06-07 20:21:48
Message-ID: 607juj15lv.fsf@dev6.int.libertyrms.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-advocacy pgsql-general pgsql-hackers

jdavis-pgsql(at)empires(dot)org (Jeff Davis) writes:
> Backtracking a little, I'm still wondering how exactly a replicated
> sequence is supposed to behave, do you have some comments about
> that? I don't understand exactly why it's useful.

The reason why it is is necessary to have some kind of handling of
sequences is the fact that tables commonly self-populate ID columns
using sequences.

create table important_table (
id serial unique not null,
descr text,
created_on timestamptz default now()
);

That "id" field is populated via a sequence.

If Slony1 is told to shift control of the system to a new master, it
won't be very nice if "test_id_seq" (the sequence that was generated)
is set to 0 on the slaves, when the master has populated hundreds or
thousands of rows and has used thousands of sequence values.

If "test_id_seq" _doesn't_ get set to a nice high value, then if a
slave gets promoted to master, new inserts into important_table will
use low ID values, and, more than likely, conflict sporadically. Bad
Thing.
--
select 'cbbrowne' || '@' || 'acm.org';
http://www3.sympatico.ca/cbbrowne/wp.html
Signs of a Klingon Programmer - 19. "My program has just dumped Stova
Core!"

In response to

Browse pgsql-advocacy by date

  From Date Subject
Next Message Fred Moyer 2004-06-07 20:29:54 Looking for data warehousing case studies in tips
Previous Message Jeff Davis 2004-06-07 18:33:58 Re: [HACKERS] Slony-I goes BETA (possible bug)

Browse pgsql-general by date

  From Date Subject
Next Message Dennis Gearon 2004-06-07 21:29:33 generic insert into table
Previous Message Scott Marlowe 2004-06-07 19:58:19 Re: [GENERAL] bug in 7.4.2, concern unicode and russian content of

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Hallgren 2004-06-07 22:08:30 Re: [HACKERS] dynamic_library_path on Win32
Previous Message Mario Weilguni 2004-06-07 19:51:12 Tool to read data files