<html><body><div style="color:#000; background-color:#fff; font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:10px"><div style="color:rgb(0, 0, 0);font-size:10px;font-family:Courier New, courier, monaco, monospace, sans-serif;background-color:transparent;font-style:normal;" class="">Hi All,<br class="" style=""><br style="" class="">I'm looking at a slony setup using 2.1.4, with 4 nodes in the following configuration:<br style="" class=""><br style="" class="">&nbsp;&nbsp;&nbsp; Node 1 --&gt; Node 2<br style="" class="">&nbsp;&nbsp;&nbsp; Node 1 --&gt; Node 3 --&gt; Node 4<br style="" class=""><br style="" class="">Node
 1 is the origin of all sets, and node 3 is a provider of all to node 
4.&nbsp; What I'm looking to do is fail over to node 2 when both nodes 1 and 3
 have gone down.<br style="" class=""><br style="" class="">Is this possible? <br style="" class=""><br style="" class="">In both a live environment that I've not had chance
 to move to 2.2 and my test environment I'm seeing the same issues, for my test environment the slonik script is:<br style="" class=""><br style="" class="">&nbsp;&nbsp;&nbsp; CLUSTER NAME = test_replication;<br style="" class=""><br style="" class="">&nbsp;&nbsp;&nbsp; NODE 1 ADMIN CONNINFO = 'dbname=TEST host=localhost port=5432 user=slony';<br style="" class="">&nbsp;&nbsp;&nbsp; NODE 2 ADMIN CONNINFO = 'dbname=TEST host=localhost port=5433 user=slony';<br style="" class="">&nbsp;&nbsp;&nbsp; NODE 3 ADMIN CONNINFO = 'dbname=TEST host=localhost port=5434 user=slony';<br style="" class="">&nbsp;&nbsp;&nbsp; NODE 4 ADMIN CONNINFO = 'dbname=TEST host=localhost port=5435 user=slony';<br style="" class=""><br style="" class="">&nbsp;&nbsp;&nbsp; SUBSCRIBE SET (ID = 1, PROVIDER = 2, RECEIVER = 4, FORWARD = YES);<br style="" class="">&nbsp;&nbsp;&nbsp; WAIT FOR EVENT (ORIGIN = 2, CONFIRMED = 4, WAIT ON = 2);<br style="" class="">&nbsp;&nbsp;&nbsp; SUBSCRIBE
 SET (ID = 2, PROVIDER = 2, RECEIVER = 4, FORWARD = YES);<br style="" class="">&nbsp;&nbsp;&nbsp; WAIT FOR EVENT (ORIGIN = 2, CONFIRMED = 4, WAIT ON = 2);<br style="" class="">&nbsp;&nbsp;&nbsp; SUBSCRIBE SET (ID = 3, PROVIDER = 2, RECEIVER = 4, FORWARD = YES);<br style="" class="">&nbsp;&nbsp;&nbsp; WAIT FOR EVENT (ORIGIN = 2, CONFIRMED = 4, WAIT ON = 2);<br style="" class=""><br style="" class="">&nbsp;&nbsp;&nbsp; DROP NODE (ID = 3, EVENT NODE = 2);<br style="" class=""><br style="" class="">&nbsp;&nbsp;&nbsp; FAILOVER (<br style="" class="">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ID = 1, BACKUP NODE = 2<br style="" class="">&nbsp;&nbsp;&nbsp; );<br style="" class=""><br style="" class="">&nbsp;&nbsp;&nbsp; DROP NODE (ID = 1, EVENT NODE = 2);<br style="" class=""><br style="" class="">slonik is failing at the first subscribe set line as follows:<br style="" class=""><br style="" class="">&nbsp;&nbsp;&nbsp; $ slonik test.scr<br style=""
 class="">&nbsp;&nbsp;&nbsp; test.scr:8: could not connect to server: Connection refused<br style="" class="">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Is the server running on host "localhost" (127.0.0.1) and accepting<br style="" class="">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; TCP/IP connections on port 5432?<br style="" class="">&nbsp;&nbsp;&nbsp; test.scr:8: could not connect to server: Connection refused<br style="" class="">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Is the server running on host "localhost" (127.0.0.1) and accepting<br style="" class="">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; TCP/IP connections on port 5434?<br style="" class="">&nbsp;&nbsp;&nbsp; test.scr:8: could not connect to server: Connection refused<br style="" class="">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Is the server running on host "localhost" (127.0.0.1) and accepting<br style="" class="">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; TCP/IP connections on port 5432?<br style=""
 class="">&nbsp;&nbsp;&nbsp; Segmentation fault<br style="" class=""><br style="" class="">I get the same behaviour until I bring node 1 back up, then the script almost succeeds, but for an error<br style="" class="">stating that a record in sl_event already exists:<br style="" class=""><br style="" class="">&nbsp;&nbsp;&nbsp; $ slonik ~/test.scr<br style="" class="">&nbsp;&nbsp;&nbsp; ~/test.scr:8: could not connect to server: Connection refused<br style="" class="">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Is the server running on host "localhost" (127.0.0.1) and accepting<br style="" class="">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; TCP/IP connections on port 5434?<br style="" class="">&nbsp;&nbsp;&nbsp; waiting for events&nbsp; (1,5000000172) only at (1,5000000162) to be confirmed on node 4<br style="" class="">&nbsp;&nbsp;&nbsp; executing failedNode() on 2<br style="" class="">&nbsp;&nbsp;&nbsp; ~/test.scr:17: NOTICE:&nbsp; failedNode: set 1 has no other
 direct receivers - move now<br style="" class="">&nbsp;&nbsp;&nbsp; ~/test.scr:17: NOTICE:&nbsp; failedNode: set 2 has no other direct receivers - move now<br style="" class="">&nbsp;&nbsp;&nbsp; ~/test.scr:17: NOTICE:&nbsp; failedNode: set 3 has no other direct receivers - move now<br style="" class="">&nbsp;&nbsp;&nbsp; ~/test.scr:17: NOTICE:&nbsp; failedNode: set 1 has other direct receivers - change providers only<br style="" class="">&nbsp;&nbsp;&nbsp; ~/test.scr:17: NOTICE:&nbsp; failedNode: set 2 has other direct receivers - change providers only<br style="" class="">&nbsp;&nbsp;&nbsp; ~/test.scr:17: NOTICE:&nbsp; failedNode: set 3 has other direct receivers - change providers only<br style="" class="">&nbsp;&nbsp;&nbsp; NOTICE: executing "_test_replication".failedNode2 on node 2<br style="" class="">&nbsp;&nbsp;&nbsp; ~/test.scr:17: waiting for event (1,5000000175).&nbsp; node 4 only on event 5000000162<br style="" class="">&nbsp;&nbsp;&nbsp;
 NOTICE: executing "_test_replication".failedNode2 on node 2<br style="" class="">&nbsp;&nbsp;&nbsp;
 ~/test.scr:17: PGRES_FATAL_ERROR lock table 
"_test_replication".sl_event_lock, 
"_test_replication".sl_config_lock;select 
"_test_replication".failedNode2(1,2,2,'5000000174','5000000176');&nbsp; - 
ERROR:&nbsp; duplicate key value violates unique constraint "sl_event-pkey"<br style="" class="">&nbsp;&nbsp;&nbsp; DETAIL:&nbsp; Key (ev_origin, ev_seqno)=(1, 5000000176) already exists.<br style="" class="">&nbsp;&nbsp;&nbsp; CONTEXT:&nbsp; SQL statement "insert into "_test_replication".sl_event<br style="" class="">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; (ev_origin, ev_seqno, ev_timestamp,<br style="" class="">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ev_snapshot,<br style="" class="">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ev_type, ev_data1, ev_data2,
 ev_data3)<br style="" class="">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; values<br style="" class="">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; (p_failed_node, p_ev_seqfake, CURRENT_TIMESTAMP,<br style="" class="">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; v_row.ev_snapshot,<br style="" class="">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 'FAILOVER_SET', p_failed_node::text, p_backup_node::text,<br style="" class="">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; p_set_id::text)"<br style="" class="">&nbsp;&nbsp;&nbsp; PL/pgSQL function _test_replication.failednode2(integer,integer,integer,bigint,bigint) line 14 at SQL statement<br style="" class="">&nbsp;&nbsp;&nbsp; NOTICE: executing "_test_replication".failedNode2 on node 2<br style="" class="">&nbsp;&nbsp;&nbsp; ~/test.scr:17: waiting for
 event (1,5000000177).&nbsp; node 4 only on event 5000000175<br style="" class="">&nbsp;&nbsp;&nbsp; ~/test.scr:21: begin transaction; - <br style="" class=""><br style="" class="">&nbsp;After this sl_set on node 4 still has node 1 as the origin for one of the sets<br style="" class="">&nbsp;(Is this possibly becasuse I'm not waiting properly or waiting on the wrong node?):<br style="" class=""><br style="" class="">&nbsp;&nbsp;&nbsp; TEST=# table _test_replication.sl_set;<br style="" class="">&nbsp;&nbsp;&nbsp; &nbsp;set_id | set_origin | set_locked |&nbsp;&nbsp;&nbsp; set_comment<br style="" class="">&nbsp;&nbsp;&nbsp; --------+------------+------------+-------------------<br style="" class="">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | Replication set 2<br style="" class="">&nbsp;&nbsp;&nbsp;
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | Replication set 1<br style="" class="">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | Replication set 3<br style="" class="">&nbsp;&nbsp;&nbsp; (3 rows)<br style="" class=""></div><div style="color:rgb(0, 0, 0);font-size:10px;font-family:Courier New, courier, monaco, monospace, sans-serif;background-color:transparent;font-style:normal;" class=""><br style="" class=""></div><div style="color:rgb(0, 0, 0);font-size:10px;font-family:Courier New, courier, monaco, monospace, sans-serif;background-color:transparent;font-style:normal;" class="">I had attached the slon logs, but my mail to the list bounced, if that would provide any better insight I can provide them.<br
 style="" class=""></div><div style="color:rgb(0, 0, 0);font-size:10px;font-family:Courier New, courier, monaco, monospace, sans-serif;background-color:transparent;font-style:normal;" class=""><br style="" class="">Any help would be greatly appreciated.</div><div style="color:rgb(0, 0, 0);font-size:10px;font-family:Courier New, courier, monaco, monospace, sans-serif;background-color:transparent;font-style:normal;" class=""><br style="" class=""></div><div style="color:rgb(0, 0, 0);font-size:10px;font-family:Courier New, courier, monaco, monospace, sans-serif;background-color:transparent;font-style:normal;" class="">Thanks</div>Glyn<div style="" class=""><br style=""></div></div></body></html>