* Christopher Browne <[EMAIL PROTECTED]> [070122 16:46]: > Alan Acosta wrote: > > So, why i need to use Slony,or better, when i want to use it ? and Are > > the random values the most important issue ?, Nobody know why > > PGCluster doesn't replicate correctly ? > Random values merely represent the easiest example to describe. > > Query-propagating systems are susceptible to data corruption for any > update that involves either a nondeterministic query, a time-sensitive > query, or host-sensitive results. > > It is completely obvious that RANDOM() provides results that are only > replicable at the same time on the same host. > > It is completely obvious that NOW() is sensitive to when it is run. > > In addition, any query of the following form will corrupt the > consistency between nodes: > > insert into t1 (select * from t2 limit 10); > > The only way that query *could* be replicable would be if it declared an > ordering on t2 that could guarantee that, on two hosts, you'd get the > same result set. E.g. - > > insert into t1 (select * from t2 order by [columns representing > candidate primary key] limit 10);
Even this will break with MVCC systems like PG, when you have more than one transaction running in parallel. Basically, MVCC gives the benefit of increasing concurrency, BUT, it includes the exact timing into the set of data needed to replay it reliably. Considering the above insert into t1 with the primary key ordering, add a second client that is inserting rows into t2 all the time. Mix in transactions and isolation levels into the drink. Stir till it turns ugly. Now, to replay these statemens correctly on a second DB server, you need to make sure that the second clients insers happen in absolutly the same relative timings. Oh, did I mention, that you need to make sure that the PG backends do have the same priorities and DO really process these statements in the same sequence? So basically, PGcluster (if it uses statement replication) is strongly broken, and will support only the most trivial usage cases. Andreas _______________________________________________ Slony1-general mailing list [email protected] http://gborg.postgresql.org/mailman/listinfo/slony1-general
