bugzilla-daemon at main.slony.info bugzilla-daemon at main.slony.info
Mon Sep 9 23:46:44 PDT 2013
http://www.slony.info/bugzilla/show_bug.cgi?id=314

--- Comment #4 from sanya <sanya-spb at list.ru> 2013-09-09 23:46:44 PDT ---
(In reply to comment #3)

> I still don't understand why you think slony isn't behaving as it should.
> 
> You have triggers installed on the node '.200' but not the node '.247'.
> 
> 
> 
> echo 'insert into test_slony.slave_a values (1,1);' | psql -h 192.168.1.247
> -d SLAVE
> INSERT 0 1
> 
> Inserts a row into slave_a in .247 directly.  None of your user triggers fire
> on .247.
> This row then replicates to .200.  When the row is inserted into slave_a on
> .200 the slave_a_trigger will run on .200 inserting a row into the 'master'
> table.
> The slony log trigger will *NOT* run on this node because the default state of
> the logTrigger is 'ENABLED' and session_replication_role is replica.
> 
> The second insert then runs 'insert into test_slony.slave_b values (1,1);' |
> psql -h 192.168.1.200
> 
> This inserts a row into slave_b and the slave_b_trigger runs which inserts a
> row into the 'master' table on .200.   The logTrigger does fire.  The table
> 'slave_b' is NOT replicated but the table 'master' is.   This results in a row
> being added to the table 'master' on the .247 machine via slony.  No triggers
> will run on .247
> 
> This means that
> .247 should have 1 row in slave_a from the first insert and 1 row in 'master'
> from the second insert
> 
> .200 will have 1 row in slave_a from the first insert,  2 rows in 'master' ,
> one from each insert, and 1 row in slave_b from the second insert.
> 
> This matches your output doesn't it?


All right, but I need to get all rows from MASTER node "master" table on SLAVE
node "master" table
I tried to change logTrigger to 'ENABLE ALWAYS', but unsuccessful

at now I have:
MASTER=# select pg_class.relname, pg_trigger.tgname, pg_trigger.tgenabled
from pg_trigger
left join pg_class on tgrelid=pg_class.oid
where pg_class.relname in ('slave_a','slave_b','master')
order by 1,2;
 relname |        tgname         | tgenabled 
---------+-----------------------+-----------
 master  | _ARIS_denyaccess      | D
 master  | _ARIS_logtrigger      | A
 master  | _ARIS_truncatedeny    | D
 master  | _ARIS_truncatetrigger | O
 slave_a | _ARIS_denyaccess      | O
 slave_a | _ARIS_logtrigger      | D
 slave_a | _ARIS_truncatedeny    | O
 slave_a | _ARIS_truncatetrigger | D
 slave_a | slave_a_trigger_after | A
 slave_b | slave_b_trigger_after | A
(10 rows)

after inserts results are the same

$ echo 'select * from test_slony.master;' | psql -h 192.168.1.200 -d MASTER
 id | some_data | idslave | slave_id 
----+-----------+---------+----------
  7 |         1 |     101 |        1
  8 |         1 |     102 |        1
(2 rows)

$ echo 'select * from test_slony.master;' | psql -h 192.168.1.247 -d SLAVE
 id | some_data | idslave | slave_id 
----+-----------+---------+----------
  8 |         1 |     102 |        1
(1 row)


As I see: trigger "_ARIS_logtrigger" not fired after trigger
"slave_a_trigger_after" when row replicates to .200 (MASTER node).
Changing the name of trigger, that it will alphabetically less then
"_ARIS_logtrigger" is not given result.

Is any possibility to cause slony1 to replicate all the rows?


Many thanks..

-- 
Configure bugmail: http://www.slony.info/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
You are the assignee for the bug.


More information about the Slony1-bugs mailing list