Re: two phase commit

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема Re: two phase commit
Дата
Msg-id 1184884970.16532.125.camel@dogma.ljc.laika.com
обсуждение исходный текст
Ответ на two phase commit  (Ben <bench@silentmedia.com>)
Список pgsql-general
On Thu, 2007-07-19 at 15:13 -0700, Ben wrote:
> I'm reading the description of PREPARE TRANSACTION, and I see this:
>
> "...its state is fully stored on disk, and there is a very high
> probability that it can be committed successfully..."
>
> What corner case reduces 2pc from "guaranteed" to "very high probability"?
> Is the worry if somebody leaves transactions in a prepared state for
> weeks, only to find that deadlock issues has arrisen at final commit time?
>

You won't get a deadlock on COMMIT, because COMMIT doesn't acquire more
locks.

The failure cases for a 2PC transaction are (as I understand it)
catastrophic. That means either the transaction can be committed, or you
probably need to restore onto new hardware anyway.

2PC is useful when multiple databases are involved and your application
crashes. When the application comes back you can look at the prepared
transactions and decide whether to COMMIT PREPARED or ROLLBACK PREPARED
based on the information in the other databases involved.

    Regards,
        Jeff Davis


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: two phase commit
Следующее
От: Ben
Дата:
Сообщение: Re: two phase commit