[PATCH] Transaction traceability - txid_status(bigint)

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема [PATCH] Transaction traceability - txid_status(bigint)
Дата
Msg-id CAMsr+YHQiWNEi0daCTboS40T+V5s_+dst3PYv_8v2wNVH+Xx4g@mail.gmail.com
обсуждение исходный текст
Ответы Re: [PATCH] Transaction traceability - txid_status(bigint)  (Craig Ringer <craig@2ndquadrant.com>)
Список pgsql-hackers
Hi all

Following on from 

bigint txids vs 'xid' type, new txid_recent(bigint) => xid


here's a patch that implements a txid_status(bigint) function to report the commit status of a function.

If an application is disconnected while a COMMIT request is in flight,
the backend crashes mid-commit, etc, then an application may not be
sure whether or not a commit completed successfully or was rolled
back. While two-phase commit solves this it does so at a considerable
overhead, so introduce a lighter alternative.

txid_status(bigint) lets an application determine the status of a
a commit based on an xid-with-epoch as returned by txid_current()
or similar. Status may be committed, aborted, in-progress (including
prepared xacts) or null if the xact is too old for its commit status
to still be retained because it has passed the wrap-around epoch
boundary.

Applications must call txid_current() in their transactions to make
much use of this since PostgreSQL does not automatically report an xid
to the client when one is assigned. 

A future protocol enhancement to report txid assignment would be very useful, but quite separate to this.


--
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services
Вложения

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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: Logical decoding restart problems
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Patch: initdb: "'" for QUOTE_PATH (non-windows)