Re: Exposing the Xact commit order to the user

From: Nicolas Barbier <nicolas(dot)barbier(at)gmail(dot)com>
To: Florian Pflug <fgp(at)phlo(dot)org>
Cc: Dan Ports <drkp(at)csail(dot)mit(dot)edu>, Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, pgsql-hackers(at)postgresql(dot)org, JanWieck(at)yahoo(dot)com
Subject: Re: Exposing the Xact commit order to the user
Date: 2010-05-25 19:53:30
Message-ID: AANLkTikKP2fNCgt_wqiavkgwD1BpbMcC_swS4qig3wsm@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2010/5/25 Florian Pflug <fgp(at)phlo(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2010-05-25 19:57:29 Re: Exposing the Xact commit order to the user
Previous Message Vick Khera 2010-05-25 19:48:04 Re: Hiding data in postgresql