2010/5/25 Florian Pflug <f...@phlo.org>: > Hm, but for there to be an actual problem (and not a false positive), an > actual dangerous circle has to exist in the dependency graph. The > existence of a dangerous structure is just a necessary (but not > sufficient) and easily checked-for condition for that, right? Now, if a > read-only transaction only ever has outgoing edges, it cannot be part > of a (dangerous or not) circle, and hence any dangerous structure it is > part of is a false positive. > > I guess my line of reasoning is flawed somehow, but I cannot figure out why...
In the general case, "wr" dependencies also create "must be serialized before" edges. It seems that those edges can be discarded when finding a pivot, but if you want to go "back to basics": ("<" means "must be serialized before".) * T1 < T2, because T1 reads a version of a data element for which T2 later creates a newer version (rw between T1 and T2). * T3 < T1, because T3 reads a version of a data element for which T1 later creates a newer version (rw between T3 and T1). * T2 < T3, because T2 creates a version of a data element, which is then read by T3 (wr between T2 and T3). (As you can see, those 3 edges form a cycle.) Nicolas -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers