[PATH] Idle in transaction cancellation

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-hackers(at)postgresql(dot)org
Subject: [PATH] Idle in transaction cancellation
Date: 2010-10-17 17:58:43
Message-ID: 201010171958.44191.andres@anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all.

Here is a proposed patch which enables cancellation of $subject. The
problematic point about doing so is that the client is not expecting any
messages from the server when its in an idle state during an transaction and
that simply suppressing that message is not enough as ready for query messages
would get sent out at unexpected places.

Thus the first patch adds the possibility to add flags to ereport()s error level
to suppress notifying the client.
It also switches the earlier "COMERROR" log level over to this flag
(LOG_NO_CLIENT) with a typedef to support the old method.

The second patch sets up a variable "silent_error_while_idle" when its
cancelling an idle txn which suppresses sending out messages at wrong places
and resets its after having read a command in the simple protocol and after
having read a 'sync' message in the extended protocol.

Currently it does *not* report any special error message to the client if it
starts sending commands in an (unbekownst to it) failed transaction, but just
the normal "25P02: current transaction is aborted..." message.

It shouldn't be hard to add that and I will propose a patch if people would
like it (I personally am not very interested, but I can see people validly
wanting it), but I would like to have some feedback on the patch first.

Greetings,

Andres

Attachment Content-Type Size
0001-Support-transporting-flags-in-the-elevel-argument-of.patch text/x-patch 4.8 KB
0002-Idle-transaction-cancellation.patch text/x-patch 4.7 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dean Rasheed 2010-10-17 18:19:30 Re: WIP: extensible enums
Previous Message Tom Lane 2010-10-17 17:53:06 Re: WIP: extensible enums