Quick question regarding how transactions propagate through slony.   
 From watching my 4 node slony cluster for over a year, it seems that  
transactions are 'serialized' from the master.  For example, I insert  
a large number of rows to my master (lets say 300,000) inside a  
transaction.  It seems that replication will start to fall out of  
sync until that transaction has been replicated throughout all my  
subscribers.  Once those rows get replicated, things catch up and  
return to Normal.  Is this correct?  Does Slony guarantee that if I  
run two transactions, X and Y, and X goes through (hits the master)  
before Y, then Y will always appear on a subscriber after X has hit  
the subscriber?  I'd heard rumors that its globally serial, and  
alternately that its serial based upon which replication set the  
transactions affect, so I'm trying to nail it down.  Anyone know?

Reason I ask:  I have a very few points (< .5% of my inserts) in my  
application that really, REALLY need to treat the cluster as  
synchronous.  I need the Java call to insert the rows to NOT return  
until the subscribers are updated.  Since Slony is async by design,  
I'm trying to get a 'poor man's sync' by inserting a row into a  
"sync_test" table AFTER I do my inserts, and then checking all master  
and subscriber nodes for that row (polling, essentially).  The theory  
is that since transactions are serialized, when my tiny little  
sync_test row comes across, I am guaranteed that my big huge insert  
has gone across to all nodes (or at least all nodes I care about).   
To my application, my insert query will not return until all  
replications are verified (yes, I know this can take many minutes,  
don't care).  I have done informal tests and this appears to work at  
least under postgresql 8.0.4 and slony 1.1.5.

Note: I care not as to whether or not this is a Smart Thing To Do, as  
I assume this is not a Smart Thing To Do and possibly even a Deadly  
Thing To Do, even going so far as to be The Stupidest Thing Ever  
Done, Bar None, Evarrr.  I'm really only curious if it would work  
(I'll even accept working 90% of the time), that there's not  
something seemingly buried in Slony that would prevent this from  
happening (such as serialized transactions based on replication set).

Thanks,

/kurt

--
Kurt Overberg
[EMAIL PROTECTED]



_______________________________________________
Slony1-general mailing list
[email protected]
http://gborg.postgresql.org/mailman/listinfo/slony1-general

Reply via email to