Jan Wieck JanWieck
Fri May 13 17:16:53 PDT 2005
On 5/13/2005 9:30 AM, Hannu Krosing wrote:

> On R, 2005-05-13 at 08:23 -0400, Jan Wieck wrote:
>> On 5/13/2005 6:38 AM, Hannu Krosing wrote:
>> 
>> The Slony-I log trigger is an AFTER trigger. Only BEFORE triggers can 
>> modify NEW. Everything that tries to modify a tuple once stored has to 
>> issue another query, thereby creating new row versions and firing the 
>> log trigger again.
>> 
>> I still have to see a test case where plperl succeeds in confusing the 
>> trigger manager so much that it forgets to fire AR triggers. That would 
>> be the only way how what Sven claims could have happened.
> 
> We had a similar problem with a BEFORE trigger (in pl/pgsql) that
> modified NEW after doing a lookup from another table. and then another
> AFTER trigger modified that row from that another table which had also
> both BEFORE and AFTER triggers.

Well, doing an update to a row in an AFTER trigger, and another BEFORE 
trigger depends on that row ... I have seen simpler methods to get your 
foot shot, but this certainly works ;-)

> 
> Could it be that ion some cases the slony UPDATEs stored inside the same
> transaction can be stored in different order then they actually
> happened ?

Hmmm ... I am not 100% sure about the trigger firing order. If an update 
to a row fires an AFTER trigger that called before the slony log 
trigger, and that AFTER trigger now updates something else ... is the 
log trigger fired for "something else" possibly called before the first 
slony log trigger fires or not? Gotta check this ...

> 
> I'll see if I can come up with a simple test case.
> 
> And it was not "reproducable" in the sense that it happened every time,
> but it did happen several times. (pg 7.4.5 slony 1.0.5)
> 

Some test cases require a dropdb, createdb cycle to reproduce. Our 
regression test might not even succeed without it.


Jan

-- 
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck at Yahoo.com #


More information about the Slony1-general mailing list