Re: Cancelling idle in transaction state

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: Cancelling idle in transaction state
Дата
Msg-id 4B3DD444.8040908@enterprisedb.com
обсуждение исходный текст
Ответ на Re: Cancelling idle in transaction state  (Simon Riggs <simon@2ndQuadrant.com>)
Ответы Re: Cancelling idle in transaction state  (Simon Riggs <simon@2ndQuadrant.com>)
Список pgsql-hackers
Simon Riggs wrote:
> Attached is the patch I intend to commit, barring objections.
> 
> This patch extends SIGINT to allow cancellation of transactions while
> idle in both HS and normal mode.

How does AbortTransactionAndAnySubtransactions() differ from
AbortOutOfAnyTransaction()? Having followed the discussions on this
patch I think I know the answer: I'm guessing that
AbortTransactionAndAnySubtransactions() leaves the backend in aborted
state, while AbortOutOfAnyTransaction() leaves it in idle state. It
would be good to point that out more clearly in the comment above
AbortTransactionAndAnySubtransactions().

I agree with Joachim's comments upthread that we should have a different
function for forcefully aborting the whole transaction, and leave the
current pg_cancel_backend() behavior alone. In any case, the
documentation of pg_cancel_backend() or the new function needs to
explain what exactly it does.

I believe people liked the idea of giving a different ERROR message when
a transaction is canceled because of conflict with recovery. It would
also be good to give a different error message when an idle transaction
is canceled using query cancel. Otherwise you don't know what hit you,
especially if you're not paying attention to NOTICEs.

> It also changes the standard message
> reported on an idle transaction in aborted state to '<IDLE> in
> transaction (aborted)', so that once aborted we keep the message even if
> the user tries to issue further statements other than ROLLBACK or
> COMMIT.

That's nice.

--  Heikki Linnakangas EnterpriseDB   http://www.enterprisedb.com


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

Предыдущее
От: Dimitri Fontaine
Дата:
Сообщение: Re: PATCH: Add hstore_to_json()
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: Cancelling idle in transaction state