Steve Singer ssinger_pg at sympatico.ca
Sat Mar 17 05:43:14 PDT 2007
On Sat, 17 Mar 2007, Mikko Partio wrote:

Your getting this because your EVENT_NODE is 1 but you only want to execute 
the script on 2.

Slonik probably should have a check to see if you have specified an only 
excecute different than your event node and just submit the script into the 
queue at that stage.

Another option is to require the event node be equal to the only 
execute node.



> Hi,
>
> slonik's EXECUTE SCRIPT -documentation says that:
>
> EXECUTE ONLY ON = ival
>
>   (Optional) The ID of the only node to actually execute the script.
>   This option causes the script to be propagated by all nodes but
>   executed only by one. The default is to execute the script on all
>   nodes that are subscribed to the set.
>
>
> In my experience this property is not working correctly, and here's the proof 
> ("tiuhti" is origin and "viuhti" subscriber):
>
> slony1 at tiuhti:~$ psql -d cldb -c "CREATE TABLE testtable (id int)" -h tiuhti
> CREATE TABLE
> slony1 at tiuhti:~$ psql -d cldb -c "CREATE TABLE testtable (id int)" -h viuhti
> CREATE TABLE
>
> slony1 at tiuhti:~$ cat drop_table_testtable.sql
> DROP TABLE testtable;
>
> slony1 at tiuhti:~$ cat droptest.slonik
> #!/usr/bin/slonik
>
> CLUSTER NAME=climate;
>
> NODE 1 ADMIN CONNINFO = 'dbname=cldb host=tiuhti user=slony1';
> NODE 2 ADMIN CONNINFO = 'dbname=cldb host=viuhti user=slony1';
>
> EXECUTE SCRIPT (
>       SET ID = 1,
>       FILENAME = '/home/slony1/drop_table_testtable.sql',
>       EVENT NODE = 1,
>       EXECUTE ONLY ON = 2
> );
>
> slony1 at tiuhti:~$ slonik droptest.slonik
> DDL script consisting of 1 SQL statements
> DDL Statement 0: (0,21) [DROP TABLE testtable;]
> Submit DDL Event to subscribers...
> DDL on origin - PGRES_TUPLES_OK
>
> slony1 at tiuhti:~$ psql -d cldb -c "\d testtable" -h viuhti
> Did not find any relation named "testtable".
>
> This is what I expected, but
>
> slony1 at tiuhti:~$ psql -d cldb -c "\d testtable" -h tiuhti
> Did not find any relation named "testtable".
>
> Wooah - the script dropped table testtable from both nodes although I 
> specified the "execute only on" -option. Is there something I'm missing or is 
> there a bug?
>
> Regards
>
> MP
>
> _______________________________________________
> Slony1-general mailing list
> Slony1-general at lists.slony.info
> http://lists.slony.info/mailman/listinfo/slony1-general
>



More information about the Slony1-general mailing list