Re: Question about SSI, subxacts, and aborted read-only xacts

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема Re: Question about SSI, subxacts, and aborted read-only xacts
Дата
Msg-id 1347342297.22899.33.camel@jdavis
обсуждение исходный текст
Ответ на Re: Question about SSI, subxacts, and aborted read-only xacts  (Dan Ports <drkp@csail.mit.edu>)
Ответы Re: Question about SSI, subxacts, and aborted read-only xacts
Список pgsql-hackers
On Mon, 2012-09-10 at 21:59 -0400, Dan Ports wrote:
> It might be worth noting that serializable mode will not cause
> read-only transactions to fail to commit

For the archives, and for those not following the paper in detail, there
is one situation in which SSI will abort a read-only transaction.

When there are three transactions forming a dangerous pattern where T1
(read-only) has a conflict out to T2, and T2 has a conflict out to T3;
and T3 is committed and T2 is prepared (for two-phase commit). In that
situation, SSI can't roll back the committed or prepared transactions,
so it must roll back the read-only transaction (T1).

Even in that case, SSI will ordinarily prevent T2 from preparing. It's
only if T1 takes its snapshot after T2 prepares and before T2 commits
that the situation can happen (I think).

Fortunately, for two-phase commit, that's not a big problem because the
window between PREPARE TRANSACTION and COMMIT PREPARED is supposed to be
narrow (and if it's not, you have bigger problems anyway). As long as
the window is narrow, than it's reasonable to retry the transaction T1,
and expect it to succeed after a short interval.

Regards,Jeff Davis




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

Предыдущее
От: Tatsuo Ishii
Дата:
Сообщение: Re: 64-bit API for large object
Следующее
От: johnlumby
Дата:
Сообщение: prefetching and asynchronous io