Christopher Browne cbbrowne
Fri Mar 11 16:20:10 PST 2005
Jan Wieck wrote:

> On 3/10/2005 11:41 PM, cbbrowne at ca.afilias.info wrote:
>
>>> I have checked in a fair "boatload" of patches supporting this and 
>>> that;
>>> from my perspective, I think it starts making sense to look towards a
>>> 1.1 release in the next couple of weeks.
>>
>
> You certainly want to add the "ACCEPT_SET" feature to the open items 
> for 1.1.
>
> We have recently discovered that MOVE_SET has a race condition. If for 
> example one has nodes 1, 2 and 3. 1 being origin, 2 and 3 being 
> subscribers. If one now does a MOVE_SET to transfer the origin to node 
> 2 there is a possibility that node 2 processes that MOVE_SET, opens up 
> for business and generates SYNC's (so far this is what we want).
>
> If now node 3 is behind in replicating from 1, but keeps well up with 
> events from node 2, it will confirm SYNC events coming from node 2 
> (assuming "I am not subscribed to anything from there, so nothing to 
> do") until it actually has caught up with 1 up to the MOVE_SET event.
>
> The cure for this is a new event type ACCEPT_SET that is generated by 
> the new origin when it processes the MOVE_SET event. The payload 
> information of ACCEPT_SET is the node id and the event id of the 
> MOVE_SET event. When processing an ACCEPT_SET event, the worker thread 
> will check if the local node has processed that MOVE_SET from the 
> other node. If not, the worker thread will error out and retry in 10 
> seconds.
>
> In the example above, node 3's worker thread 2 will receive the 
> ACCEPT_SET, notice that worker thread 1 hasn't processed the MOVE_SET 
> yet, suspend event processing for 10 seconds and retry. Since all 
> relevant SYNC events on node 2 happen past the ACCEPT_SET event, 
> nothing can get lost any more.

This is, in fact, already in 1.1...

cbbrowne at dba2:Slony-I/slony1-HEAD/src/slon> cvs log  -r1.77 
remote_worker.c                           Friday 11:18:02

RCS file: /usr/local/cvsroot/slony1/slony1-engine/src/slon/remote_worker.c,v
Working file: remote_worker.c
head: 1.77
branch:
locks: strict
access list:
symbolic names:
    REL_1_0_5: 1.55.2.7
    REL_1_0_4: 1.55.2.7
    REL_1_0_2: 1.55.2.4
    REL_1_0_1: 1.55.2.1
    REL_1_0_0: 1.55
    REL_1_0_STABLE: 1.55.0.2
    REL_1_0_0_RC1: 1.55
    REL_1_0_0_BETA3: 1.51
    REL_1_0_0_BETA2: 1.49
    REL_1_0_0_BETA1: 1.49
    Sample1: 1.22
keyword substitution: kv
total revisions: 84;    selected revisions: 1
description:
----------------------------
revision 1.77
date: 2005/03/07 23:27:03;  author: cbbrowne;  state: Exp;  lines: +646 -342
Major changes to log shipping, allowing it to support substantially
all events (to the degree supportible).  Notably, COPY_SET now
copies the contents of tables in newly subscribed sets.

Also includes a new event, ACCEPT_SET, which addresses a race condition
where updates might be lost. If ACCEPT_SET is received before the
MOVE_SET has been processed, then the slon will wait until it has
received both.
=============================================================================



More information about the Slony1-general mailing list