mikymike michaelsalomon78 at gmail.com
Thu Jul 31 09:22:26 PDT 2008
I'm new to this forum so allow me to say hello to each and everyone =)

Here is my problem...

I have three nodes and one replicated table.. Node 1 is master for two
slaves nodes (2 and 3)

I use Slony 1.2.11.

Here is the inital config after I complete the setup of my cluster :

node_id | hostname
---------+----------
       1 | Master
       2 | Slave 1
       3 | Slave 2

 repset_id | schema_name | table_name | origin_node
-----------+-------------+------------+-------------
         1 | my_schema     | my_table  |           1

 sub_set | sub_provider | sub_receiver | sub_forward | sub_active
---------+--------------+--------------+-------------+------------
       1 |            1 |            2 | t           | t
       1 |            1 |            3 | t           | t

Then I perform a failover from node 1 to node 2, basically doing this :

        failover (id = 1, backup node = 2);
        echo 'Failover done';

        echo 'Subscribing node 3 to node 2 and wait for synchronization';
        subscribe set ( id = 1, provider = 2, receiver = 3, forward = yes);
        sync (id = 2);
        wait for event ( origin = 2, confirmed = 3, wait on = 2);
        echo 'Subscription complete !';

        echo 'Dropping master node';
        drop node (id=1, event node=2);

Config is now :


 node_id | hostname
---------+----------
       2 | Slave 1
       3 | Slave 2



 repset_id | schema_name | table_name | origin_node
-----------+-------------+------------+-------------
         1 | my_schema     | my_table  |           2


 sub_set | sub_provider | sub_receiver | sub_forward | sub_active
---------+--------------+--------------+-------------+------------
       1 |            2 |            3 | t           | t


Then I perform a switchover from node 2 to old master 1 :

        echo 'Creation of Master Node';
        store node (id=1, comment= 'Master', event node=2);

        echo 'Storage of all pathes';
        store path (server=1, client=2, conninfo='service=master1');
        store path (server=1, client=3, conninfo='service=master1');
        store path (server=2, client=1, conninfo='service=slave2');
        store path (server=2, client=3, conninfo='service=slave2');
        store path (server=3, client=1, conninfo='service=slave3');
        store path (server=3, client=2, conninfo='service=slave3');

        echo 'Set subscribtion for both slave nodes';
        subscribe set (id=1, provider=2, receiver= 1, forward= yes);
        sync (id = 2);
        wait for event (origin  = 2, confirmed = 1, wait on = 2);

        subscribe set (id=1, provider=2, receiver= 3, forward= yes);
        sync (id = 2);
        wait for event (origin  = 2, confirmed = 3, wait on = 2);

        echo 'Moving master from node 2 to node 1...';
        lock set (id=1, origin=2);
        move set (id=1, old origin=2, new origin=1);
        echo 'waiting for completion of move...';
        wait for event (origin = ALL, confirmed = ALL);
        echo 'switch over complete';

And now here is the new config I end up to :

 node_id | hostname
---------+----------
       1 | Master
       2 | Slave 1
       3 | Slave 2

 repset_id | schema_name | table_name | origin_node
-----------+-------------+------------+-------------
         1 | my_schema     | my_table  |           1

 sub_set | sub_provider | sub_receiver | sub_forward | sub_active
---------+--------------+--------------+-------------+------------
       1 |            2 |            3 | t           | t
       1 |            1 |            2 | t           | t

You can see that sub_set 1 has now two different providers, instead of only
1 ... I really wounder why node 2 is still provider for this set. I was
thinking it should only display sub_provider = 1... Why is that ?

It does not really affect the replication because at this stage node 2 is
actually a slave for this set, but still I wanted to know if this was normal
and if somehow my scripts were incorrect...

thanks a lot for your help !!

michael 
-- 
View this message in context: http://www.nabble.com/Strange-thing-happens-after-switchover-tp18758313p18758313.html
Sent from the Slony-I -- General mailing list archive at Nabble.com.



More information about the Slony1-general mailing list