Christopher Browne cbbrowne at ca.afilias.info
Wed May 16 14:13:40 PDT 2007
"Dmitry Koterov" <dmitry at koterov.ru> writes:
> Thanks!
> Seems it is what I was looking for:
> 1. Current state of the Master:
> master# STATE := (select st_last_event from _cluster.sl_status limit 1)

Sounds good!

> 2. Current slave ID:
> slave# SLAVE_ID := (select _cluster.getlocalnodeid('_cluster'));

Yes, that would be how to determine it...

> 3. If the slave is more up-to-date than master:
> master# (select min(st_last_received) from _cluster.sl_status where st_received = SLAVE_ID) >= STATE

It should never be possible for a subscriber to be more up to date
than the origin.

Firstly, that logically doesn't make sense.  (At least, when we're not
in a universe where time travels backwards, objects 'fall' *away* from
gravity wells, and such...)

Secondly, implementation-wise, it can't happen because the subscriber
can't ask for events until the origin has actually generated them.
-- 
select 'cbbrowne' || '@' || 'ca.afilias.info';
<http://dba2.int.libertyrms.com/>
Christopher Browne
(416) 673-4124 (land)


More information about the Slony1-general mailing list