Brad Nicholson bnichols at ca.afilias.info
Thu Mar 15 06:35:12 PDT 2007
On Thu, 2007-03-15 at 08:15 -0500, Dan Falconer wrote:
> 	DISCLAIMER: I don't know a lot about the internals of Slony, especially when 
> it comes to how records get into the tables within Slony's replication 
> schema.
> 
> 	That said, it seems to me that there should be a way to wholly reduce the 
> apparent amount of work involved in maintaining sequences: in sl_sequence, 
> create a column that contains the last value for each of the sequences.  
> Presumably, there would be a process that checks the current value of each 
> sequence... if it determined that the sequence had changed, run an update on 
> the last sequence (for the master), and do whatever it normally did to note 
> that the slaves should update their sequences.

This won't work.  It only tracks the last value of the sequence, not the
changes to the sequence data.  It's entirely likely that nodes will be
processing different syncs at different times.

For example

sync 1
 seq_y=1

sync 2
 seq_y=2

Node 1 is the provider and node 2 is the subscriber

A time t

Node1
-Has generated sync 2 - seq_y=2

Node 2 has only processed sync 1

On node 2 - seq_y should = 1, but that sequence data has been
overwritten, and all you know is the value of seq_y=2.  The node is in
an inconsistent state.

-- 
Brad Nicholson  416-673-4106
Database Administrator, Afilias Canada Corp.



More information about the Slony1-general mailing list