Re: Exposing the Xact commit order to the user

Поиск
Список
Период
Сортировка
От Florian Pflug
Тема Re: Exposing the Xact commit order to the user
Дата
Msg-id 1B65D4DC-B0F5-4CD3-8718-B7CBC9243C74@phlo.org
обсуждение исходный текст
Ответ на Re: Exposing the Xact commit order to the user  (Dan Ports <drkp@csail.mit.edu>)
Ответы Re: Exposing the Xact commit order to the user  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Re: Exposing the Xact commit order to the user  (Dan Ports <drkp@csail.mit.edu>)
Re: Exposing the Xact commit order to the user  (Nicolas Barbier <nicolas.barbier@gmail.com>)
Список pgsql-hackers
On May 25, 2010, at 20:18 , Dan Ports wrote:
> On Tue, May 25, 2010 at 02:00:42PM +0200, Nicolas Barbier wrote:
>> I don't understand the problem. According to me, in the context of
>> SSI, a read-only slave can just map SERIALIZABLE to the technical
>> implementation of REPEATABLE READ (i.e., the currently-existing
>> "SERIALIZABLE"). The union of the transactions on the master and the
>> slave(s) will still exhibit SERIALIZABLE behavior because the
>> transactions on the slave cannot write anything and are therefore
>> irrelevant.
>
> This, unfortunately, isn't true in SSI.
>
> Consider read-only transactions on a single node SSI database -- the
> situation is the same for read-only transactions that run on a slave.
> These transactions can be part of anomalies, so they need to be checked
> for conflicts and potentially aborted.
>
> Consider Kevin's favorite example, where one table contains the current
> date and the other is a list of receipts (initially empty).
>  T1 inserts (select current_date) into receipts, but doesn't commit
>  T2 increments current_date and commits
>  T3 reads both current_date and the receipt table
>  T1 commits
>
> T3, which is a read-only transaction, sees the incremented date and an
> empty list of receipts. But T1 later commits a new entry in the
> receipts table with the old date. No serializable ordering allows this.
>
> However, if T3 hadn't performed its read, there'd be no problem; we'd
> just serialize T1 before T2 and no one would be the wiser.

Hm, so in fact SSI sometimes allows the database to be inconsistent, but only as long as nobody tries to observe it?

Btw, I still don't get how this follows from the Cahill paper. For a transaction to lie on a dangerous circle, it needs
incomingand outgoing edges in the conflict graph, right? But I'd have though that conflicts are always between a reader
anda writer or between two writers. So how can a read-only transaction have incoming and outgoing edges? 

best regards,
Florian Pflug




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Dan Ports
Дата:
Сообщение: Re: Exposing the Xact commit order to the user
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: tsvector pg_stats seems quite a bit off.